in reply to Regexp::Common balanced curlies substitution

It's easy if you do it two lines:
$str =~ /$RE{balanced}{-parens=>'{}'}/ and substr $str. $-[0] + 1, $+[0] - $-[0] - 2, 'REPLACEMENT'