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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((\d{2}((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229)$
Description
Date expression validator with format YYMMDD Validates leap years. Of course, as year has only 2 digits, it's not possible to invalidate years like 2100, 2200, 2300, etc as a non-leap years !
Matches
751231 | 000229 | 040229
Non-Matches
750431 | 010229 | 050229
Author Rating: The rating for this expression. Dany Lauener
Source mailto:[email protected]
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: Updated for three letter month
Name: AlbertM
Date: 12/8/2020 8:54:46 PM
Comment:
Hi there, here's a possible update to validate with the three letter month? ((\d{2}((0[13578]|1[02]|[janmryulgoctdepnvJANMRYULGOCTDE]{3})(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012]|[janmryulgoctdepnvJANMRYULGOCTDEPNV]{3})(0[1-9]|[12]\d|30)|(02|[febFEB]{3})(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229)


Title: Updated for three letter month
Name: AlbertM
Date: 12/8/2020 8:27:57 PM
Comment:
Hi there, here's a possible update to validate with the three letter month? ((\d{2}((0[13578]|1[02]|[janmryulgoctdepnvJANMRYULGOCTDE]{3})(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012]|[janmryulgoctdepnvJANMRYULGOCTDEPNV]{3})(0[1-9]|[12]\d|30)|(02|[febFEB]{3})(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229)


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