Mexico is my favorite country. I like Mexico. Welcome to Mexico--a fun place. #### my @countries = ( # make a list of regex's qr/(?}; my %found; foreach my $re ( @countries ){ $found{$1}++ while $s =~ s/\b($re)\b/====/s; # NOTE: this is destructive to $s, but does get us the counts. } use Data::Dumper; print Dumper \%found; __DATA__ Mexico is my favorite country. I like Mexico. Welcome to Mexico--a fun place. New Mexico US France Germany U.S.A. USA U.S. US United States United States of America The United States The United States of America