Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Regular Expression Question
Vladimir M. Zakharychev schrieb:
>
> On Jan 30, 3:51 am, "m.t" <m..._at_matelot.com> wrote:
>> I have comments like this "/* this is comment */" >> is dynamic SQL string. >> >> Please show me how I can use Regular Expression to >> replace the comments with NULL. >> >> THANKS ! >> >> -- >> 10gR2
For nongreedy simulation on 10gR1 this can work:
with t as (select 'select /* comments */ * from /* more comments */
dual;' s from dual)
select
regexp_replace(s, '(/\*[^*]*\*/)',NULL)
from t;
There was a very good thread about regexp authored by CD on the OTN
http://forums.oracle.com/forums/thread.jspa?threadID=435109 http://forums.oracle.com/forums/thread.jspa?threadID=430647 http://forums.oracle.com/forums/thread.jspa?threadID=427716
where he discussed differences between 10gR1 and 10gR2 among other things, buttom line - an excellent introduction for Oracle regexp.
Best regards
Maxim Received on Tue Jan 30 2007 - 04:59:20 CST
![]() |
![]() |