Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Help with regular expression

Help with regular expression

From: Barry <bbulsara23_at_hotmail.com>
Date: 25 Jun 2006 05:28:10 -0700
Message-ID: <1151238490.287073.239510@u72g2000cwu.googlegroups.com>


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



#second#

SQL> Received on Sun Jun 25 2006 - 07:28:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US