This makes it work for nested parens, too, like "hi; there; (fools; (all))"$REx = qr{ \( (?: (?> [^()]+) | (??{ $REx }) )* \) }x; $str =~ s/($REx)/(my $a = $1) =~ tr!;!,!; $a/eg;
In reply to RE: Search and Replace
by japhy
in thread Search and Replace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |