I would just like to explain a bit about giving up on regex calisthenics. The problem is trying to match a "recursive pattern" another example of which would be matching balanced parenthesis which is a Perl FAQ.
p =~ () p =~ (p) p =~ pp
The faq and answer are here: Can I use Perl regular expressions to match balanced text?
In reply to Re^2: When the only tool you have is a screwdriver...
by mr_ron
in thread When the only tool you have is a screwdriver...
by ExReg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |