Question
 Recommend 
How do I strip html from a string in perl?
I just want to remove all html from the < to > and keep only the remaining text.
Asked on: Apr 15, 2009
  Answer
 No 
 Yes 
Was this answer helpful? 
There are multiple ways of doing this.

You can use the HTML::Strip module.

There are other perl modules that do the function as well like HTML::Parser or HTML::FormatText

or if you want to just use a 1 line regex expression, you can use this code.

  Perl Code Snippet:
$string_with_html =~ s/<.+?>//g;


That will remove all html tags from the string. But it is not extremely helpful if you want to work with the html.
Answered on: Apr 16, 2009
  Got the Answer?
  Loading
 X 
Loading...