I think it's worth repeating what tilly and mstone have mentioned; that is, matching balanced delimiters cannot be done with a (formal) regular expression. Perl's "regexes", however, are more powerful than (formal) regular expressions, and (with some contortions) can match balanced delimiters.
For the sake of whoever maintains your code, though, use Text::Balanced instead, and keep the gnarly regexes in reserve for when they're the best tool for the job.
--
:wq
In reply to Re(2): Re: parsing question
by FoxtrotUniform
in thread Re: parsing question
by sliles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |