use strict; use warnings; my @bah = ( "Australia", "Austria", "Finland", "Norway" ); my $regex = join ('|', map { "(?:$_)" } @bah); my $foo = "In Australia the people from Austria drink beer at the pub with the people from Norway"; my $result = ""; my @data = $foo =~ /($regex)/g; print join ", ", @data;