how about this, assuming @strings is an array containing a list of "somethings" to replace:
This will replace every first occurence of every string in @strings with "__[username]__[$string]__"for my $string (@strings) { $input =~ s/\[\Q$string\E\]/__[username]__[$string]__/; }
update: see perlretut
In reply to Re: Regex help
by Joost
in thread Regex help
by snacktime
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |