in reply to Advanced replace function
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Advanced replace function
by ikegami (Patriarch) on Dec 04, 2009 at 19:49 UTC |