from
437109
Hi cd_2.
You has not introduced 11gR1 regex new features.
Therefore I will introduce it B-)
***********************************************************************************
RegExp_Count
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions145.htm
Since Oracle11gR1 There is new function
RegExp_Count
RegExp_Count counts how many strings which has match pattern.
sampleSQL
select
RegExp_Count('abc','[a-cas cnt1,
RegExp_Count('abc','[ac as cnt2,
RegExp_Count('abc','[0-9as cnt3
from dual;
cnt1 cnt2 cnt3
---- ---- ----
3 2 0
***********************************************************************************
6th parameter of RegExp_SubStr
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions148.htm
Since Oracle11gR1 There is new 6th parameter at
RegExp_SubStr.
This 6th parameter can emulate regex Lookahead and lookbehind.
but This can emulate easy case only.
for ex
(?=.*abc)ghi can emulate.
But
(?=.*abc)(?=.*def)ghi cannot emulate.
sampleSQL
select
RegExp_Substr('abc1def2','([a-z])[0-9]',1,1,null,1)
as "emulate [a-z](?=[0-9])",
RegExp_Substr('1def2','[a-z]([0-9])',1,1,null,1)
as "emulate (?<=[a-z])[0-9]"
from dual;
e e
- -
c 2