in reply to Efficient way to match and replace nested braces (etc.)

use Regexp::Common qw /balanced/; my $re = qr{$RE{balanced}{-begin => "{{"}{-end => "}}"}}; $text =~ s/$re//g;