while (<DATA>) { chomp; if (/^(19|20)([5-9]|[0-5])([0-9])$/) { print "it matches for $_\n"; } } __DATA__ 1950 2050 2001 2009 2000
It says: first two digits should be 19 or 20, third digit can go from 5 to 9 or 0 to 5 and the fourth digit is 0-9.
In reply to Re: Matching date range with pure regex
by podian
in thread Matching date range with pure regex
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |