Title |
Test
Find
check ISO date
|
Expression |
^((((19[0-9][0-9])|(2[0-9][0-9][0-9]))([-])(0[13578]|10|12)([-])(0[1-9]|[12][0-9]|3[01]))|(((19[0-9][0-9])|(2[0-9][0-9][0-9]))([-])(0[469]|11)([-])([0][1-9]|[12][0-9]|30))|(((19[0-9][0-9])|(2[0-9][0-9][0-9]))([-])(02)([-])(0[1-9]|1[0-9]|2[0-8]))|(([02468][048]00)([-])(02)([-])(29))|(([13579][26]00)([-])(02)([-])(29))|(([0-9][0-9][0][48])([-])(02)([-])(29))|(([0-9][0-9][2468][048])([-])(02)([-])(29))|(([0-9][0-9][13579][26])([-])(02)([-])(29)))$ |
Description |
This regex checks if a date is in ISO-format (yyyy-mm-dd). Leap year should be checked too. Date has to be between 1900-01-01 and 2999-12-31. |
Matches |
1900-01-01 | 2025-03-15 | 2999-12-31 |
Non-Matches |
1890-01-01 | 2008-19-45 | 3000-01-01 |
Author |
Rating:
Patrick Metz
|
Source |
This regex is a combination/modification of others found on RegExLib.com |
Your Rating |
|
Title: gg
Name: LeRune
Date: 11/30/2021 1:26:57 AM
Comment:
Great regex!
Title: gg
Name: LeRune
Date: 11/30/2021 1:26:50 AM
Comment:
Great regex!
Title: gg
Name: LeRune
Date: 11/30/2021 1:26:42 AM
Comment:
Great regex!