in reply to Help with Substitution
$line = "{john{david{mary{{{{martin}"; $line =~ s/{(?=[{}])/{empty/g; [download]