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 xml tags, including tags with chr(10)s in between them

kron777Dec 19 2011 — edited Dec 19 2011
regexp experts!

I have the following string held in a table (there's a carriage return in the middle, and there could be multiple carriage returns):

<COMMENT>This is a test line1

Regards, testing team </COMMENT>

I've searched all the forums without success for a) a regexp_subtr to return just the bits between the tags or a b) regexp_replace to replace the tags with another string.

So ideally I'm looking for a regexp_substr to return

This is a test line1

Regards, testing team

or a regexp_replace to return

<NEW_TAG>This is a test line1

Regards, testing team </NEW_TAG>

Any advice appreciated!

Edited by: user13007502 on 19-Dec-2011 06:00
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2012
Added on Dec 19 2011
8 comments
5,284 views