REGEXP_SUBSTR question -
01-14-2013
, 03:07 PM
Hi,
I try to match different parts of a string delimited by '$$' followed by a letter.
Example of a string
$$aSingapore ;$$aHackensack, N.J. :$$bWorld Scientific Pub. Co.,$$cc2011.
Examples of regexp on the strings I tried
-1-
SELECT REGEXP_SUBSTR(z00r_text, '(\$\$a.*\$\$a)*') from z00r where substr(z00r_field_code,1,3) = '260' and rownum < 11;
REGEXP_SUBSTR(Z00R_TEXT,'(\$\$A.*\$\$A)*')
--------------------------------------------------------------------------------
$$aSingapore ;$$a
-2-
SELECT REGEXP_SUBSTR(z00r_text,'(\$\$a(.*)\$)*(\$\$)*') || ' ' || REGEXP_SUBSTR(z00r_text,'(\$\$c(.*)\$)*(\$\$)*') from z00r where substr(z00r_field_code,1,3) = '260' and rownum < 11;
REGEXP_SUBSTR(Z00R_TEXT,'(\$\$A(.*)\$)*(\$\$)*')|| ''||REGEXP_SUBSTR(Z00R_TEXT,'(
--------------------------------------------------------------------------------
$$aSingapore ;$$aHackensack, N.J. :$$bWorld Scientific Pub. Co.,$$ $$
-3-
SELECT REGEXP_SUBSTR(z00r_text,'(\$\$a.*\$\$[a^b-z]{1})',1,1,'i') from z00r where substr(z00r_field_code,1,3) = '260' and rownum < 11;
REGEXP_SUBSTR(Z00R_TEXT,'(\$\$A.*\$\$[B-Z]{1})',1,1,'I')
--------------------------------------------------------------------------------
$$aSingapore ;$$aHackensack, N.J. :$$bWorld Scientific Pub. Co.,$$c
Is there away with the REGEXP_SUBSTR function to get :
$$aSingapore ;$$aHackensack, N.J. :
or
$$bWorld Scientific Pub. Co.,
or
$$cc2011.
Thanks a lot,
Luc
--
Posted by Mimo Usenet Browser v0.2.5
http://www.mimousenet.com/mimo/post |