Title |
Test
Find
Date-MM/DD/YYYY MONTH/DATE/YEAR
|
Expression |
^((0[1-9])|(1[0-2]))\/((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))\/(\d{4})$ |
Description |
This regular expressions matches dates in the format MM/DD/YYYY where MM can be 01 to 12, DD can be 01 to 31 and YYYY is always 4 digits long. |
Matches |
12/25/2007 | 11/07/1517 | 02/25/2727 |
Non-Matches |
1/27/1977 | 00/01/000 | 15/07/2002 |
Author |
Rating:
Ravi Nandan Vaish
|
Source |
|
Your Rating |
|
Title: doesn't handle days in February and leap years
Name: JC
Date: 10/29/2007 4:58:02 PM
Comment:
This regular expression would accept 2/30/2007. Is there an updated version to handle this?
Title: Not strict
Name: Michael Ash
Date: 4/19/2007 10:50:22 AM
Comment:
No check for days in month or leap years. Will match invalid dates