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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))$
Description
Based on some of the other patterns on RegExpLib. This is the ISO way of writing dates.
Matches
2002-01-31 | 1997-04-30 | 2004-01-01
Non-Matches
2002-01-32 | 2003-02-29 | 04-01-01
Author Rating: Not yet rated. Knut Hamang
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

Title: Expended
Name: Prignon Yves
Date: 5/9/2007 10:59:15 AM
Comment:
Goes only to 2099


Title: Almost
Name: Michael Ash
Date: 4/28/2004 11:23:50 AM
Comment:
1900 wasn't a leap year. 1900-02-29 should fail.


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