After a little playing around, I came up with this:
#!/usr/bin/perl -w use strict; my @stuff = qw(1234 a12345 12345 12345z 123456); foreach my $num (@stuff) { unless ($num =~ /^\d{5,}$/) { print "Not Valid: $num\n"; } else { print "Valid: $num\n"; } }
Note the $ anchor there...this should match any string of digits that's at least 5 digits long, and it will fail for anything with non-digits in it.
EDIT: Removed the extra crap before the $ anchor.
In reply to Re: Regex Pattern Problem
by myocom
in thread Regex Pattern Problem
by THRAK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |