Title |
Test
Find
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:
Radek
|
Source |
|
Your Rating |
|