Displaying page
of
pages;
Items to
Title |
Test
Details
.NET RegEx mm/dd/yyyy date validation
|
Expression |
\b(((0[13578]|1[02])[\/\.-]?(0[1-9]|[12]\d|3[01])[\/\.-]?(19|20)?(\d{2}))|(0[13456789]|1[012])[\/\.-]?(0[1-9]|[12]\d|30)[\/\.-]?(19|20)?(\d{2}))|(02[\/\.-]?(0[1-9]|1\d|2[0-8])[\/\.-]?(19|20)?(\d{2}))|(02[\/\.-]?29[\/\.-]?(19|20)?((0[48]|[2468][048]|[13579][26])|(00)))\b
|
Description |
I needed to have a way where users could type in any date format like the following: mm/dd/yyyy, mm/dd/yy, mmddyy, mmddyyyy with the ability to use "/" and "." and "-" or nothing as separation characters. I use this in a RegularExpression Validator control in ASP.NET
|
Matches |
032103|02/29/2008|10.31.1990|010102
|
Non-Matches |
2-29-00|11.31.1992|063178|02/29/2005
|
Author |
Rating:
Not yet rated.
Ken Fayal
|
Displaying page
of
pages;
Items to