in reply to Advanced replace function
... or, one of several possible alternates, on the off chance (ymmv) you find this will be easier to read someday, down the road:
my $regex = qr'(?:\[.*?\])'; compile regex; use non-capture grouping $str =~ s/$regex/~~/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Advanced replace function
by ikegami (Patriarch) on Dec 05, 2009 at 05:50 UTC | |
|
Re^2: Advanced replace function
by AnomalousMonk (Archbishop) on Dec 05, 2009 at 04:34 UTC |