Have you considered using the core Perl module Text::Balanced?
In reply to Re: Efficient way to match and replace nested braces (etc.)
by eyepopslikeamosquito
in thread Efficient way to match and replace nested braces (etc.)
by dmn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |