in reply to Need help with substitue /g

perlfaq6 Can I use Perl regular expressions to match balanced text?