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!

How to remove rtf tags from string in sql

234495Dec 5 2008 — edited Dec 5 2008
Hi,

I want to remove rtf tags from a database field (varchar2) in a sql statement.
is saw the regexp_replace example below, but it does not work, it returns nothing.

I can do it in javascipt regex using ^\{(.+)|^\\(.+)|(\}* but Oracle uses Posix regex so that
will also not work.

I like to use regexp_replace, but can not find the correct regex string.

Any ideas ???



select replace(regexp_replace(regexp_replace(replace(regexp_replace(regexp_replace(text,'(par |par)')
2 ,'(.* |.*|{.*|}.*)')
3 ,chr(10),'~')
4 ,'^(~*)|(~*)$')
5 ,'(~){2,}','~')
6 ,'~',chr(10))
7 from tbl_clob;

Hans Nieuwenhuis

Edited by: hansbeta on Dec 5, 2008 12:56 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 2 2009
Added on Dec 5 2008
1 comment
1,420 views