XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Here's the regex for the xs:dateTime datatype

I'm not sure why you've modified this from the regex given in the XSD 1.1 spec which is (ignoring whitespace):

-?([1-9][0-9]{3,}|0[0-9]{3})
-(0[1-9]|1[0-2])
-(0[1-9]|[12][0-9]|3[01])
T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))
(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?
The XSD version allows years with more than four digits and places different restrictions on the timezone offset.

Your version also seems to have a serious bug in that it only allows the hour to be in the range 01 to 12.

Both of these regular expressions allow any month to have 31 days. For that reason, I'm not sure either of them is particularly useful.

Michael Kay
Saxonica

On 13 Aug 2018, at 19:44, Costello, Roger L. <costello@mitre.org> wrote:

(\-?[0-9]{4}\-(0[1-9]|1[0-2])\-(0[1-9]|[1-2][0-9]|3[0-1])T(0[1-9]|1[0-2]):(0[0-9]|[1-4][0-9]|5[0-9]):(0[0-9]|[1-4][0-9]|5[0-9])(\.[0-9]+)?(([\+\-]1[0-2]:(0[0-9]|[1-4][0-9]|5[0-9]))|Z)?)



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS