[Home] [By Thread] [By Date] [Recent Entries]

  • From: Michael Kay <mike@s...>
  • To: "Costello, Roger L." <costello@m...>
  • Date: Mon, 13 Aug 2018 21:45:12 +0100

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@m...> 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]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member