SQL> select 1 from dual where regexp_like('Alibaba-13930471222','^alibaba-[139|135|152][0-9]+{8}$');
1
----------
SQL> select 1 from dual where regexp_like('Alibaba-13930471222','^alibaba-[139|135|152][0-9]+{8}$', 'c');
1
----------
SQL> select 1 from dual where regexp_like('Alibaba-13930471222','^alibaba-[139|135|152][0-9]+{8}$', 'i');
1
----------
1
|
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[0-9]+') from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
30637
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[0-9]+', 1) from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
30637
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[0-9]+', 35) from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[0-9]+', 1, 2) from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[a-z_0-9]+', 35) from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
showart_1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/Showart_1009927.html', '[a-z_0-9]+', 35) from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
howart_1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/Showart_1009927.html', '[a-z_0-9]+', 35, 1, 'c') from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
howart_1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/Showart_1009927.html', '[a-z_0-9]+', 35, 1, 'i') from dual;
REGEXP_SUBSTR('HTTP://BLOG.CHI
------------------------------
Showart_1009927
|
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[0-9]+') from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
12
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[0-9]+', 21) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
52
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[0-9]+', 1, 2) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
52
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[0-9]+', 1, 1, 0) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
12
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[0-9]+', 1, 1, 1) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
20
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[0-9]+', 1, 2, 0) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
52
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[0-9]+', 1, 2, 1) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
60
SQL> select regexp_instr('http://shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 1, 1, 0) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
8
SQL> select regexp_instr('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 1, 1, 0) from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
9
SQL> select regexp_instr('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 1, 1, 0, 'i') from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
8
SQL> select regexp_instr('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 1, 1, 0, 'c') from dual;
REGEXP_INSTR('HTTP://SHOP35741
------------------------------
9
|
SQL> select regexp_replace('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 'YCT') from dual;
REGEXP_REPLACE('HTTP://SHOP357
--------------------------------------------------
http://SYCT.taobao.com/shop/xshop/wui_page-YCT.htm
SQL> select regexp_replace('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 'YCT', 20) from dual;
REGEXP_REPLACE('HTTP://SHOP357
----------------------------------------------------------
http://Shop35741645.taobao.com/shop/xshop/wui_page-YCT.htm
SQL> select regexp_replace('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 'YCT', 1, 2) from dual;
REGEXP_REPLACE('HTTP://SHOP357
----------------------------------------------------------
http://Shop35741645.taobao.com/shop/xshop/wui_page-YCT.htm
SQL> select regexp_replace('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 'YCT', 1, 1) from dual;
REGEXP_REPLACE('HTTP://SHOP357
-------------------------------------------------------
http://SYCT.taobao.com/shop/xshop/wui_page-16115021.htm
SQL> select regexp_replace('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*[0-9]+', 'YCT', 1, 1, 'i') from dual;
REGEXP_REPLACE('HTTP://SHOP357
------------------------------------------------------
http://YCT.taobao.com/shop/xshop/wui_page-16115021.htm
SQL> select regexp_replace('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*([0-9])+', '\1', 1, 1, 'i') from dual;
REGEXP_REPLACE('HTTP://SHOP357
----------------------------------------------------
http://5.taobao.com/shop/xshop/wui_page-16115021.htm
SQL> select regexp_replace('http://Shop35741645.taobao.com/shop/xshop/wui_page-16115021.htm', '[a-z]*([0-9]+)', '\1', 1, 1, 'i') from dual;
REGEXP_REPLACE('HTTP://SHOP357
-----------------------------------------------------------
http://35741645.taobao.com/shop/xshop/wui_page-16115021.htm
|
-- REGEXP_LIKE --
function REGEXP_LIKE (srcstr VARCHAR2 CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
modifier VARCHAR2 DEFAULT NULL)
return BOOLEAN;
pragma FIPSFLAG('REGEXP_LIKE', 1452);
function REGEXP_LIKE (srcstr CLOB CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
modifier VARCHAR2 DEFAULT NULL)
return BOOLEAN;
pragma FIPSFLAG('REGEXP_LIKE', 1452);
-- REGEXP_INSTR --
function REGEXP_INSTR(srcstr VARCHAR2 CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
position PLS_INTEGER := 1,
occurrence PLS_INTEGER := 1,
returnparam PLS_INTEGER := 0,
modifier VARCHAR2 DEFAULT NULL)
return PLS_INTEGER;
pragma FIPSFLAG('REGEXP_INSTR', 1452);
function REGEXP_INSTR(srcstr CLOB CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
position INTEGER := 1,
occurrence INTEGER := 1,
returnparam PLS_INTEGER := 0,
modifier VARCHAR2 DEFAULT NULL)
return INTEGER;
pragma FIPSFLAG('REGEXP_INSTR', 1452);
-- REGEXP_SUBSTR --
function REGEXP_SUBSTR(srcstr VARCHAR2 CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
position PLS_INTEGER := 1,
occurrence PLS_INTEGER := 1,
modifier VARCHAR2 DEFAULT NULL)
return VARCHAR2 CHARACTER SET srcstr%CHARSET;
pragma FIPSFLAG('REGEXP_SUBSTR', 1452);
function REGEXP_SUBSTR(srcstr CLOB CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
position INTEGER := 1,
occurrence INTEGER := 1,
modifier VARCHAR2 DEFAULT NULL)
return CLOB CHARACTER SET srcstr%CHARSET;
pragma FIPSFLAG('REGEXP_SUBSTR', 1452);
-- REGEXP_REPLACE --
function REGEXP_REPLACE(srcstr VARCHAR2 CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
replacestr VARCHAR2 CHARACTER SET srcstr%CHARSET
DEFAULT NULL,
position PLS_INTEGER := 1,
occurrence PLS_INTEGER := 0,
modifier VARCHAR2 DEFAULT NULL)
return VARCHAR2 CHARACTER SET srcstr%CHARSET;
pragma FIPSFLAG('REGEXP_REPLACE', 1452);
function REGEXP_REPLACE(srcstr CLOB CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
replacestr CLOB CHARACTER SET srcstr%CHARSET
DEFAULT NULL,
position INTEGER := 1,
occurrence INTEGER := 0,
modifier VARCHAR2 DEFAULT NULL)
return CLOB CHARACTER SET srcstr%CHARSET;
pragma FIPSFLAG('REGEXP_REPLACE', 1452);
function REGEXP_REPLACE(srcstr CLOB CHARACTER SET ANY_CS,
pattern VARCHAR2 CHARACTER SET srcstr%CHARSET,
replacestr VARCHAR2 CHARACTER SET srcstr%CHARSET
DEFAULT NULL,
position INTEGER := 1,
occurrence INTEGER := 0,
modifier VARCHAR2 DEFAULT NULL)
return CLOB CHARACTER SET srcstr%CHARSET;
pragma FIPSFLAG('REGEXP_REPLACE', 1452);
-- End REGEXP Support --
|