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