Thus my question: what is the easiest way to handle it?If it's really a simple matter of matching braces then you could indeed use a regex
Check out Re: Graph File Parsing for some regex style parsing, or if you'd prefer to stay away from regexes there's always Text::Balanced.use Regexp::Common; my $str = <<CODE; env { foo { bar {} } } CODE print $str =~ /($RE{balanced}{-parens => '{}'})/; __output__ { foo { bar {} } }
_________
broquaint
In reply to Re: Parsing... possible w/o too much stress ?
by broquaint
in thread Parsing... possible w/o too much stress ?
by spurperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |