Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Answer: How would I find a piece of html from a sourcefile.html?

by dsb (Chaplain)
on Jan 24, 2001 at 02:54 UTC ( #53832=categorized answer: print w/replies, xml ) Need Help??

Q&A > regular expressions > How would I find a piece of html from a sourcefile.html? - Answer contributed by dsb

This regular expression will grap the entire tag, brackets and all.
$data =~ m/(<[^>]+>)/; print $1, "\n"; # print the tag
This regex will leave out the brackets and print only the string inside them:
$data =~ m/<([^>]+)>/; print $1, "\n"; # print the tag
Use modifiers, or loops as you need too. -kel

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2016-12-05 04:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (72 votes). Check out past polls.