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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Date YYYY-MM-DD including leap year
Expression
^(((\d{4}-((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])00|\d{2}([13579][26]|0[48]|[2468][048])))-02-29)){0,10}$
Description
This expression mathes dates formatted as YYYY-MM-DD from 0000-01-01 to 9999-12-31. It checks leap year including all modulo 400, modulo 100 and modulo 4 rules.
Matches
2013-01-14 | 2000-02-29 | 0000-12-12
Non-Matches
2012-02-29 | 966-04-30 | 2013-01-32
Author Rating: The rating for this expression. Radek
   Displaying page 1 of 1 pages; Items 1 to 1

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