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 -> Oracle regular experssion

Oracle regular experssion

From: <peterdempsey1_at_hotmail.co.uk>
Date: 3 Mar 2007 09:39:25 -0800
Message-ID: <1172943565.480938.282260@h3g2000cwc.googlegroups.com>


Hello, in my query the # are really spaces.

My question is in regexp_replace, is there a way to remove the leading #'s as well.

select regexp_replace('a#b#cde#fghi#j','[a-z]+','',1,1) from dual; select regexp_replace('a#b#cde#fghi#j','[a-z]+','',1,2) from dual;

You can see one of the first query result has a leading #. I am thinking that I have to "select trim(regexp_replace( etc))" Is that right?

Thank you for your help.

Peter G. Dempsey

What I see is below (10.2 on Solaris 10 V210)

SQL>
SQL>
SQL> select regexp_replace('a#b#cde#fghi#j','[a-z]+','',1,1) from
dual;
select regexp_replace('a#b#cde#fghi#j','[a-z]+','',1,2) from dual;

REGEXP_REPLAC



#b#cde#fghi#j

SQL>
REGEXP_REPLAC



a##cde#fghi#j Received on Sat Mar 03 2007 - 11:39:25 CST

Original text of this message

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