Gossamer Forum
Home : General : Perl Programming :

Algorithm to remove html tag

Quote Reply
Algorithm to remove html tag
Anyone can give me a simple algorithm to remove a html tags from a let's say a variable named $notes....
Quote Reply
Re: Algorithm to remove html tag In reply to
You're best off using the html::parse modules, available from CPAN.

No need to reinvent the wheel.

--Mark

------------------
You can reach my by ICQ at UID# 8602162

Quote Reply
Re: Algorithm to remove html tag In reply to
I strongly agree with Mark, because I tried to reinvent the wheel already, only to find out it was being used by everyone around me. Here is a same snippet for you to try:
Code:
use HTML::Parser;

$p = HTML::Parser->new;
$p->parse($notes); # parse the HTML in notes
$p->eof; # signal end of parse file
print $p->as_string; # print out the parsed text
Hope this helps


------------------
Fred Hirsch
Web Consultant & Programmer