in reply to Regular expression pattern matching question

Regular expressions are not needed or particularly useful here. How about the following instead:

my $ProdBuild = 'K7000AKNBJQ4333'; my $ProdBuildNum = substr($ProdBuild, -4); foreach (@pattern) { if (substr($ProdBuild, -4) >= $ProdBuildNum) { print("$_\n"); } }

Or if you can have dashes in between the digits, how about the following:

sub GetProdBuildNum { local $_ = @_ ? $_[0] : $_; s/\D//g; return substr($_, -4); } my $ProdBuild = 'K7000AKNBJQ4333'; my $ProdBuildNum = GetProdBuildNum($ProdBuild); foreach (@pattern) { if (GetProdBuildNum >= $ProdBuildNum) { print("$_\n"); } }