全部博文(136)
分类: Oracle
2009-06-30 09:57:18
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('
------------------------------
30637 SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[0-9]+', 1) from dual;
REGEXP_SUBSTR('
------------------------------
30637
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[0-9]+', 35) from dual;
REGEXP_SUBSTR('
------------------------------
1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[0-9]+', 1, 2) from dual;
REGEXP_SUBSTR('
------------------------------
1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/showart_1009927.html', '[a-z_0-9]+', 35) from dual;
REGEXP_SUBSTR('
------------------------------
showart_1009927
SQL> select regexp_substr('http://blog.chinaunix.net/u/30637/Showart_1009927.html', '[a-z_0-9]+', 35) from dual;
REGEXP_SUBSTR('
------------------------------
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('
------------------------------
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('
------------------------------
Showart_1009927 |
SQL> select regexp_instr('', '[0-9]+') from dual;
REGEXP_INSTR('
------------------------------
12
SQL> select regexp_instr('', '[0-9]+', 21) from dual;
REGEXP_INSTR('
------------------------------
52
SQL> select regexp_instr('', '[0-9]+', 1, 2) from dual;
REGEXP_INSTR('
------------------------------
52
SQL> select regexp_instr('', '[0-9]+', 1, 1, 0) from dual;
REGEXP_INSTR('
------------------------------
12
SQL> select regexp_instr('', '[0-9]+', 1, 1, 1) from dual;
REGEXP_INSTR('
------------------------------
20
SQL> select regexp_instr('', '[0-9]+', 1, 2, 0) from dual;
REGEXP_INSTR('
------------------------------
52
SQL> select regexp_instr('', '[0-9]+', 1, 2, 1) from dual;
REGEXP_INSTR('
------------------------------
60
SQL> select regexp_instr('', '[a-z]*[0-9]+', 1, 1, 0) from dual;
REGEXP_INSTR('
------------------------------
8
SQL> select regexp_instr('', '[a-z]*[0-9]+', 1, 1, 0) from dual;
REGEXP_INSTR('
------------------------------
9
SQL> select regexp_instr('', '[a-z]*[0-9]+', 1, 1, 0, 'i') from dual;
REGEXP_INSTR('
------------------------------
8
SQL> select regexp_instr('', '[a-z]*[0-9]+', 1, 1, 0, 'c') from dual;
REGEXP_INSTR('
------------------------------
9 |
SQL> select regexp_replace('', '[a-z]*[0-9]+', 'YCT') from dual;
REGEXP_REPLACE('
--------------------------------------------------
SQL> select regexp_replace('', '[a-z]*[0-9]+', 'YCT', 20) from dual;
REGEXP_REPLACE('
----------------------------------------------------------
SQL> select regexp_replace('', '[a-z]*[0-9]+', 'YCT', 1, 2) from dual;
REGEXP_REPLACE('
----------------------------------------------------------
SQL> select regexp_replace('', '[a-z]*[0-9]+', 'YCT', 1, 1) from dual;
REGEXP_REPLACE('
-------------------------------------------------------
SQL> select regexp_replace('', '[a-z]*[0-9]+', 'YCT', 1, 1, 'i') from dual;
REGEXP_REPLACE('
------------------------------------------------------
SQL> select regexp_replace('', '[a-z]*([0-9])+', '\1', 1, 1, 'i') from dual;
REGEXP_REPLACE('
----------------------------------------------------
SQL> select regexp_replace('', '[a-z]*([0-9]+)', '\1', 1, 1, 'i') from dual;
REGEXP_REPLACE('
-----------------------------------------------------------
|
-- 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 -- |