Given data like this:
I want to end up with a hash containing the keys and values implied by this format. This was my first try:<%def .errors> missing_name: You must provide your name. missing_email: You must provide your email address. </%def>
But of course that only gets the first one. Is there a way to get them all without first trimming the text?my %errors = ( $data =~ m|<\%def \.errors>.*?(?:(^\w+):(.*?)$)+.*?</\%def>|sgm );
In reply to regex parsing brainteaser by perrin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |