Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 scrutinizing the Monastery: (7)
As of 2014-09-30 23:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (386 votes), past polls