Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

REGEXP_REPLACE not replacing all occurrences

593002Sep 27 2007 — edited Sep 27 2007
Hi,
I'm using REGEXP_REPLACE to replace all occurences of this: &#anychar; by ~#anychar;

the problem is that it is only replacing the first occurence.
I tried to move and remove the occurences around but it still only matches/replaces the first one.

This is the sql (in my code, it takes a CLOB but for testing purposes I'm using this string - in both cases it behaves the same):
SELECT REGEXP_REPLACE( '<title>\&#rr55;Alberta \&ggg9;Regulations\&#x2014; 10</title>',
'&#(.*;)', '~#\1') from dual;

I tried the occurrences arg and position arg but still the same:
SELECT REGEXP_REPLACE('....', '&#(.*;)', '~#\1', 1, 0) from dual;

Any help is appreciated.
thanks a lot.

Message was edited by:
user589999

Message was edited by:
user589999

Message was edited by:
user589999
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2007
Added on Sep 27 2007
1 comment
739 views