Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Parsing with RegEx into Array

by mr_p (Scribe)
on Jun 25, 2010 at 18:17 UTC ( #846579=note: print w/ replies, xml ) Need Help??


in reply to Re: Parsing with RegEx into Array
in thread Parsing with RegEx into Array

that worked perfectly. but what If <item> is < item> (with a space in it. Is there a way to handle it?


Comment on Re^2: Parsing with RegEx into Array
Re^3: Parsing with RegEx into Array
by ikegami (Pope) on Jun 25, 2010 at 18:31 UTC

    Are you really asking how to optionally match a space with a regex?

Re^3: Parsing with RegEx into Array
by JediWizard (Deacon) on Jun 25, 2010 at 18:31 UTC

    $str =~ m{<\s*item\s*><i>(.*?)</i></\s*item\s*>}

    They say that time changes things, but you actually have to change them yourself.

    —Andy Warhol

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2014-11-24 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (147 votes), past polls