Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: regex parsing brainteaser

by Roy Johnson (Monsignor)
on Apr 01, 2008 at 20:35 UTC ( #677829=note: print w/replies, xml ) Need Help??


in reply to regex parsing brainteaser

my %errors = ( $data =~ m#(?:<\%def \.errors>|\G).*?(?:(^\w+):(.*?)$)(?=.*?</\%de +f>)#sgm );
It's not immune to matching before or after the tags, though. That gets uglier:
my %errors = ( $data =~ m#(?:<\%def \.errors>|(?<=.)\G)(?:(?!</\%def>).)*?(?:(^\w ++):([^\n]*))(?=.*?</\%def>)#sgm );

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2023-03-24 19:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (61 votes). Check out past polls.

    Notices?