Title |
Test
Find
XML Schema DateTime
|
Expression |
-?[0-9]{4}-(((0(1|3|5|7|8)|1(0|2))-(0[1-9]|(1|2)[0-9]|3[0-1]))|((0(4|6|9)|11)-(0[1-9]|(1|2)[0-9]|30))|(02-(0[1-9]|(1|2)[0-9])))T([0-1][0-9]|2[0-4]):(0[0-9]|[1-5][0-9]):(0[0-9]|[1-5][0-9])(\.[0-999])?((\+|-)([0-1][0-9]|2[0-4]):(0[0-9]|[1-5][0-9])|Z)? |
Description |
Matches xs:dateTime values described in XML Schema 1.0. Handles correct days in each month.
http://www.w3.org/TR/xmlschema-2/#dateTime |
Matches |
2012-01-31T10:00:00Z | 2012-02-28T10:00:00Z | 2012-02-29T10:00:00Z |
Non-Matches |
2012-02-30T10:00:00Z | 2012-01-32T10:00:00Z | 2012-04-31T10:00:00Z |
Author |
Rating:
Not yet rated.
Adam Retter
|
Source |
Author |
Your Rating |
|
Title: Small fix
Name: Adam Retter
Date: 2/20/2021 11:07:47 AM
Comment:
The regex for the fractional sections is incorrect. Should instead be:
-?[0-9]{4}-(((0(1|3|5|7|8)|1(0|2))-(0[1-9]|(1|2)[0-9]|3[0-1]))|((0(4|6|9)|11)-(0[1-9]|(1|2)[0-9]|30))|(02-(0[1-9]|(1|2)[0-9])))T([0-1][0-9]|2[0-4]):(0[0-9]|[1-5][0-9]):(0[0-9]|[1-5][0-9])(\.[0-9]{3})?((\+|-)([0-1][0-9]|2[0-4]):(0[0-9]|[1-5][0-9])|Z)?