[tt]var s="2007"; //the input retrieved as sting
var rx=/^(19[0-9]{2}|20[0-4][0-9]|2050)$/;
if (rx.test(s)) {
//within the range
} else {
//outside of the range
}[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.