in reply to Matching date range with pure regex
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Matching date range with pure regex
by MCS (Monk) on Feb 17, 2004 at 18:20 UTC |