How to remove rtf tags from string in sql
234495Dec 5 2008 — edited Dec 5 2008Hi,
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