while ($text=~m/(( \{+) .*? (??{ '\}' x length $2 }))/xg) { $text=~s/\Q$1\E/ /; }
Of course, suggestions for improvements are more than welcome. :)
- DMNIn reply to Re: Efficient way to match and replace nested braces (etc.)
by dmn
in thread Efficient way to match and replace nested braces (etc.)
by dmn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |