Title |
Test
Find
DD-MM-YYYY Format Date Validator
|
Expression |
^((29-02-(19|20)(([02468][048])|([13579][26])))|(31-((0[13578])|(1[02]))|(30-((0[13456789])|(1[0-2])))|(29-((0[13456789])|(1[0-2])))|(((0[1-9]|)|(1[0-9])|(2[0-8]))-((0[1-9])|(1[0-2])))-((19|20)[0-9][0-9])))$ |
Description |
This expression can be used to validate any date entered in correct DD-MM-YYYY format. Takes care of Leap Years too.. |
Matches |
29-02-2008 | 30-04-2007 | 01-01-1975 |
Non-Matches |
29-02-2007 | 31-11-2008 | 31-13-1999 |
Author |
Rating:
Not yet rated.
Arya K Choudhury
|
Source |
Independent |
Your Rating |
|
Title: Leap year has error
Name: Michael Ash
Date: 1/9/2009 12:09:06 PM
Comment:
Your leap year check has an error. 1900 was not a leap year.
Also you could also save a few keystrokes in your month checks by using [13-9] for 30th and non Feb 29th
Title: useful
Name: user
Date: 1/9/2009 2:07:22 AM
Comment:
good