Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Help with regular expression
10.2 RHL; Hi I am new to regular expressions. I am trying to get the
second word from a sentence using a regular expression. The sentence
uses '#' instead of spaces to make easy to read in
comp.databases.oracle.server. My query almost does what I want, but it
still has the word surrounded by '#'. Can someone help me with the
regular expression to do the substring excluding the '#'. I know in the
real system where I have spaces, I can use TRIM but instead I would
rather have the regular expression right to start with and not have to
do this.
Thanks
Barry
SQL> SELECT REGEXP_SUBSTR('return#second#word#in#sentence','#[^#]*#')
FROM DUAL;
2
REGEXP_S
SQL> Received on Sun Jun 25 2006 - 07:28:10 CDT