Regular Expression Match to test for a valid year

Years from 1000 to 2999

^[12][0-9]{3}$

For 1900-2099

^(19|20)\d{2}$

Leave a Comment