Sql 删除Oracle中带有或200和x标题
我需要删除所有的html标签。我使用regexp_replace,但当文本中有>或<字符时,它会失败Sql 删除Oracle中带有或200和x标题,sql,oracle,Sql,Oracle,我需要删除所有的html标签。我使用regexp_replace,但当文本中有>或200和x标题 应为:head1正文:x>200和x
WITH T AS
(SELECT '<HTML><HEAD>head1</HEAD><BODY>body<P>text: x > 200 and x < 1000;</P><H1>headline</H1></BODY></HTML>' STR FROM DUAL
)
select REGEXP_REPLACE(STR, '<[^>]+>|\&(nbsp;)|(amp;)', ' ') from T;
输出为:标题1正文文本:x>200和x标题
应为:head1正文:x>200和x<1000;标题如果您有有效的XML/XHTML注意:使用 | TEXT | | :------------------------------------------- | | head1bodytext: x > 200 and x < 1000;headline | | TEXT | | :----------------------------------------------------------- | | head1 body text: x > 200 and x < 1000; headline |