HTML Tags in Data -- I want to remove them

  • I have a web enabled application.  I have a few hundred records that have HTML tags in the data.  Would someone have a function written to parse out the HTML tags for a specific column?

     

    Thanks in advance

     

  • Do you have a list of tags ?

  • No... I was thinking about removing anything that looks like "<....>"

  • You likely need to do a little programming/scripting using a regular expression to remote the tags.  Suggest you do a web search for "regular expression remote html tags" and you'll find the re expressions you can use.

    Good luck,

    Pete

  • Try HTML::Strip from perl. I know this is not a sql based answer but this is the easiest. If you had to absolutely do it in sql then you need to use something that will find the indexof the first "<" then the next ">" and strip anything in between. I am not the best with regex, so i will refrain on commenting on that approach. I hope this helped.

  • Or just use replace to replace the "<" and ">" with "&lt;" and "&gt;" before you put the data into the page.  Then the tags will display as text rather that be processed as html tags.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply