RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find MySQL Date
Expression
^(19|20)[0-9]{2}-((01|03|05|07|08|10|12)-(0[1-9]|[12][0-9]|3[01]))|(02-(0[1-9]|[12][0-9]))|((04|06|09|11)-(0[1-9]|[12][0-9]|30))$
Description
Checks for a MySQL valid date formated as Y-M-D. January, March, May, July, August, Octobe and December are valid with max of 31 days, February is valid with max of 29 days, April, June, September and November are valis with max of 30 days. Valid for years from 1900 to 2099.
Matches
2012-12-31 | 1999-01-29 | 1995-06-01
Non-Matches
2012-02-30 | 1999-04-31 | 1872-06-01
Author Rating: Not yet rated. Ilia Goranov
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials