Don't ask to ask, just ask | |
PerlMonks |
Re: Re: Re: Stripping of HTML contentby mp (Deacon) |
on Sep 12, 2002 at 16:31 UTC ( [id://197272]=note: print w/replies, xml ) | Need Help?? |
Depending on how much inaccuracy you can tolerate, you can get a reasonable facsimile of stripping all HTML by doing:
assuming the entire page content is in $page. A line by line approach like that in your original post will fail on tags that span multiple lines. The regexp above will break if you have unbalanced < or > inside of html tags, but may be good enough for your use.
In Section
Seekers of Perl Wisdom
|
|