in reply to multiple matches in a string
To replace All occurrances of a match in a string, instead of just the first, use the /g flag:
Update:"perldoc perlre" was my attempt at a friendly "rtfm" :) Sorry it didn't come across forcefully enough :)$string = "foo, this foo is just a foo"; $string =~ s/foo/bar/g;
Alan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |