Although I like a spicy regex as much as the next guy, I think that the use of the flip-flop operator, as pointed out by pbeckingham and diebyz is much more elegant and (probably) more efficient, since it allows you to avoid slurping the file that is being parsed.
The 'scalar range' / 'flip-flop' operator is one of the sweetest pieces of syntactical sugar that Perl offers, if you ask me.
In reply to Re^2: Regex for simple parsing job
by Art_XIV
in thread Regex for simple parsing job
by toadi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |