Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Re: Stripping of HTML content

by mp (Deacon)
on Sep 12, 2002 at 16:31 UTC ( [id://197272]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Stripping of HTML content
in thread Stripping of HTML content

Depending on how much inaccuracy you can tolerate, you can get a reasonable facsimile of stripping all HTML by doing:
$page =~ s/<[^<>]*>//g; # Note the added < inside []
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://197272]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-28 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found