It's not immune to matching before or after the tags, though. That gets uglier:my %errors = ( $data =~ m#(?:<\%def \.errors>|\G).*?(?:(^\w+):(.*?)$)(?=.*?</\%de +f>)#sgm );
my %errors = ( $data =~ m#(?:<\%def \.errors>|(?<=.)\G)(?:(?!</\%def>).)*?(?:(^\w ++):([^\n]*))(?=.*?</\%def>)#sgm );
In reply to Re: regex parsing brainteaser
by Roy Johnson
in thread regex parsing brainteaser
by perrin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |