Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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.


Comment on Re: regex parsing brainteaser
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
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 chanting in the Monastery: (9)
As of 2015-07-03 06:50 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 (48 votes), past polls