foreach my $val (@vals) { print "Numeric\n" if $val =~ /^[0-9]{2}/; }