W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2005

Re: Regex syntax [+-]

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Fri, 5 Aug 2005 08:08:56 +0100
Message-ID: <001501c5998c$b4c3d010$b700a8c0@RW>
To: "Michael Kay" <mike@saxonica.com>, <xmlschema-dev@w3.org>

Original Message From: "Michael Kay" <mike@saxonica.com>

> In particular, what characters are allowed to appear as s and e in a range
> [s-e]?
>
> The production rules say
>
> [18]   seRange    ::=   charOrEsc '-' charOrEsc
> [20]   charOrEsc    ::=   XmlChar | SingleCharEsc
> [21]   XmlChar    ::=   [^\#x2D#x5B#x5D]
>
> which imply that [, ], \, and - are disallowed in both positions.

I'm not sure if I'm looking at the same version as you (Schema part 2 second 
edition), but my reading is that the characters [, ], \, and - are covered 
by the SingleCharEsc production:

      [24]    SingleCharEsc    ::=    '\' [nrt\|.?*+(){}#x2D#x5B#x5D#x5E]


So you might end up with something like: [\[-\]]

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
                         for XML to C++ data binding visit
                         http://www.tech-know-ware.com/lmx
                         (or http://www.xml2cpp.com)
=============================================
Received on Friday, 5 August 2005 07:10:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:50 GMT