Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Answer: Strip that XML!

( #745438=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > Strip that XML! contributed by ramrod

Here's another easy method:
$_ = <<EOF; <xml> <email>toto@foo.com</email><name>Toto</name> <email>tata@bar.com</email><name>Tata</name> <email>tutu@baz.com</email><name>Tutu</name> </xml> EOF my @email = /<email>(.*?)<\/email>/g; my @name = /<name>(.*?)<\/name>/g;
(Note that it leaves XML entities undecoded, as noted in the reply.)

Comment on Answer: Strip that XML!
Download Code
Re: Answer: Strip that XML!
by Anonymous Monk on Mar 01, 2009 at 08:19 UTC
    That doesn't decode entities (its broken).
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-06 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls