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
|