in reply to Regex Pattern Problem
unless ($num =~ /^\d{5,}/ && $num !~/\w/)According to Robert's Perl Tutorial "The \w construct actually means 'word' - equivalent to a-zA-Z_0-9"
Because \w includes digits it looks as if this regex might reject all numbers. I tried out the following code here:
and sure enough the number 123456 did not match the regex.my $num = "123456"; unless ($num =~ /^\d{5,}/ && $num !~/\w/) { print p("Sorry, $num does not match the regex"); } else {print p("$num matched")};
|
|---|