That's exactly what I would do. 3 lines max.
> But isn't there something cleaner and more general?
I beg your pardon? Plz define "cleaner"
You can certainly use some convoluted huge nested regex for this, which is hardly better maintainable.
(I'm sure tybalt is already preparing one)
Or an extra module with some proprietary parsing grammar. But that's only replacing one DSL with another.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re: s///g within m//g regions
by LanX
in thread s///g within m//g regions
by almr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |