[Javascript] Validate date via Regular Expression

grzegorz.stasica at delphiauto.com grzegorz.stasica at delphiauto.com
Fri Sep 13 08:12:53 CDT 2002


Hi,

What is wrong with this regular expression:
var re=/\b((19|20)\d{2})[\-](1[0-2]|0?[1-9])[\-](0?[1-9]|[12][0-9]|3[01])/

I'm trying to check if date is correct.Date format should by YYYY-MM-DD but when
I validate  somethig like this: 2002-12-54 the test expression doesn't see any
error ?







More information about the Javascript mailing list