Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Using a Regex to extract tagged content

by lestrrat (Deacon)
on Feb 27, 2004 at 16:25 UTC ( [id://332292]=note: print w/replies, xml ) Need Help??


in reply to Using a Regex to extract tagged content

davido gave the correct answer already, but here's a simple hack regexp that matches your particular example.

/<([a-zA-Z]+)(?:(?:\s+[^>]+)*|\s*)>([^<]*)<\/\1>/

This *will* break in a lot of cases, so if you can at all, use one of the modules that davido recommended, not a silly hack like this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found