in reply to Regex help
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
|
|---|