in reply to Regex help

what's in @list? Why does your code match "@@something@@" while your explenation states "[something]"?

how about this, assuming @strings is an array containing a list of "somethings" to replace:

for my $string (@strings) { $input =~ s/\[\Q$string\E\]/__[username]__[$string]__/; }
This will replace every first occurence of every string in @strings with "__[username]__[$string]__"

update: see perlretut