You may be looking for the /g option to s///:
my $str="abc t[poop1] def [doop2] [woop3] xyz"; $str =~ s/\[.*?\]/~~/g; print "$str\n"; __END__ abc t~~ def ~~ ~~ xyz
In reply to Re: Advanced replace function
by kyle
in thread Advanced replace function
by sans-clue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |