use strict; use warnings; my @strings; $strings[0] = "44 (1234) 123398 Ext 123"; $strings[1] = "+44 (1234) 123398 Ext 123"; $strings[2] = "44 (1234) 123398 Ext 123 xxxxxxxxxxxxxxx"; $strings[3] ="416-967-1111 ext. 123 xxxxxxxxxxxxxxxxx"; my $counter=0; for my $string (@strings) { if ($string =~/^(?:Ext|\d|\)|\(|\.|\s|\+|\-)+$/i) { print "$counter good\n"; } $counter++; }