W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2007

RE: [Bug 3659] Bugs in date/time regexes

From: Michael Kay <mike@saxonica.com>
Date: Mon, 17 Dec 2007 10:38:05 -0000
To: "'Pete Cordell'" <petexmldev@tech-know-ware.com>, <www-xml-schema-comments@w3.org>, <bugzilla@wiggum.w3.org>
Message-ID: <00b901c84098$e87668e0$6501a8c0@turtle>

> I just looked at this bug text and one of the things it 
> recommends is using \d instead of [0-9].  However, as I 
> understand it, (sadly!) \d is equivalent to Unicode \p{Nd}, 
> which matches digits in many languages such as ARABIC-INDIC 
> DIGIT ZERO at character code 0660 and so on.

Yes, I think you are right - [0-9] should not be replaced with \d.

(Of course, if you're defining a restriction of a string that is already
constrained then this doesn't matter. People, including the authors of the
spec, often overlook the fact that when you're restricting a string that is
already constrained, your regular expression doesn't need to repeat the
constraints that are already present. For example, if you want to restrict
xs:integer to be five digits, the pattern "....." is quite adequate.)

Michael Kay
http://www.saxonica.com/
Received on Monday, 17 December 2007 10:38:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:07 UTC