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 and removing start/end tags

ToddBarryAug 18 2014 — edited Aug 18 2014

I'm looking to use regexp_replace in 11gR2 to remove start and end tags in a CLOB where the start tag is =" and the end tag is ".

For example, the content could be:

First ="Second" Third"3rd" ="Fourth" Fifth

and the desired output would be:


First Second Third"3rd" Fourth Fifth

This can't be a standard replace because that "3rd" needs to stay as-is in the output.

I've tried:

select regexp_replace(:string, '="(?:(?!").)*', '') from dual;

but this leaves the end tag:

First Second" Third"3rd" Fourth" Fifth

Thanks,

Todd

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2014
Added on Aug 18 2014
4 comments
913 views