for my $str (qw(aaa_gjh1_dfgdf_0009 aaa_gjh_0000 aaa_fdsfs_000 aaa_sdf_jdsh_01111)) { print (is_valid($str) ? "ok $str\n" : "not ok $str\n"); }