W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2005

[Bug 1850] [F&O] how do ranges work in case-insensitive mode?

From: <bugzilla@wiggum.w3.org>
Date: Wed, 31 Aug 2005 14:44:01 +0000
To: public-qt-comments@w3.org
Message-Id: <E1EATon-0003gR-Qi@wiggum.w3.org>


------- Additional Comments From mike@saxonica.com  2005-08-31 14:43 -------
Here are some observations from Java:

(a) it appears that a character matches a range if any case-variant of the
character matches the range:

   matches("D", "[A-Z]", "i")  = true
   matches("d", "[A-Z]", "i")  = true

(b) this rule also works for subtractions:

   matches("D", "[A-Z-[D]]", "i")  = true
   matches("d", "[A-Z-[D]]", "i")  = true

(c) the rule doesn't work for negative character groups. Here it appears that ^d
removes both "d" and "D" from the group (whereas the rule above would suggest
that it removes neither)

   matches("D", "[^d]", "i")  = false
   matches("d", "[^d]", "i")  = false

(d) it appears that the "i" flag has no effect on character blocks. 

   matches("D", "\p[Lu]", "i") = true;
   matches("d", "\p[Lu]", "i") = false;
   matches("D", "\P[Lu]", "i") = false;
   matches("d", "\P[Lu]", "i") = true;

This is a terribly empirical way of approaching a specification!
Received on Wednesday, 31 August 2005 14:44:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:07 UTC