How about simply adding the $ anchor to your current regex? (5 or more digits and then the end of the string):
unless ($num =~ /^\d{5,}$/) { # and more generally to combine a couple of conditions: unless ($num =~ /^\d{5,}/ and $num !~ /\D/) {
In reply to Re: Regex Pattern Problem
by danger
in thread Regex Pattern Problem
by THRAK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |