Can anyone tell me why the month matches is coming up true? It is October (10) of course.
$month matches error
kraig109
#1
ipaterson
#2
It matches the 1
since this is looking only at whether $month
contains the pattern. To require a match of the entire value, modify the expression a bit to match only at the start and end of the string: /^(1|2|3|4|11|12)$/
With that expression you will only get matches when the value is exactly 1, 2, 3, 4, 11, or 12.