1. Below query is used to eliminate html tags and other entities like & ,  etc.
SELECT trim(regexp_replace('<p style="margin-left:30px;">Replacing html tags & entities with space using regular expresion .</p>',
'<.+?>|\&(nbsp;)|(amp;)|(quot;)|(lt;)|(gt;)', ' ')) as plain_col
FROM dual ;
FROM dual ;
Result:
Replacing html tags & entities with space using regular expression.
2. If you want to add new entity like font-size:xx-large; add the code in the above expression as shown below.
SELECT trim(regexp_replace(column_name,
'<.+?>|\&(nbsp;)|(amp;)|(quot;)|(lt;)|(gt;) |
(font-size:xx-large;)', ' ')) as plain_col
FROM Table_Name ;
FROM Table_Name ;
3
No comments:
Post a Comment