W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

Character reference in regular expressions

From: Satoshi Nakamura <snakamura@infoteria.co.jp>
Date: Tue, 27 Mar 2001 16:07:36 +0900
To: www-xml-schema-comments@w3.org
Message-Id: <141620010327155035snakamura@infoteria.co.jp>
In XML Schema Datatypes F, the spec says that character references can
appear in regular expressions. However, it seems that there is no need.

First, character references are expanded by an XML processor before passed
to regexpr parser. Who wants to write,

<pattern value="[&amp;#x4d;]">

instead of writing simply,

<pattern value="[&#x4d;]">


Second, "[&#x4d;]" (written "[&amp;#x4d;]" in XML) can be parsed as both
one "XmlCharRef" and six "XmlChar"s.


If there are needs to use UCS code point in regular expressions (for
patterns not written in XML), it should be expressed using escape
character, such as \u... .

---
Satoshi Nakamura <snakamura@infoteria.co.jp>
Infoteria Corporation
Received on Tuesday, 27 March 2001 02:07:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:50 GMT