W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2003

Re: schema pattern matching (negate)

From: Robin Berjon <robin.berjon@expway.fr>
Date: Tue, 01 Jul 2003 17:18:52 +0200
Message-ID: <3F01A65C.6070003@expway.fr>
To: Jeni Tennison <jeni@jenitennison.com>
Cc: Colin Mackenzie <colin@elecmc.com>, xmlschema-dev@w3.org

Jeni Tennison wrote:
> I think you can use:
>   (([^S].*)|(S[^T].*)|(ST[^R].*))
> in other words, the string can start with something that isn't S; or
> it can start with S, as long as it's followed by something that isn't
> T; or it can start with ST, as long as it's followed by something that
> isn't R.

Yes, but that will get terribly hairy if your string is longer than three 
characters, or if instead of a fixed string you're negating a pattern.

Similarly, I couldn't find anything in the spec to control case-sensitivity. Did 
I miss it or has it been overlooked? Without it it is a true pain matching 
case-insensitive values (barbaz becoming [bB][aA][rR][bB][aA][rR]).

While on this topic, I'd like to point out that a lot of literature out there 
states that XML Schema borrowed Perl's patterns, sometimes saying that it added 
Unicode support. That's fairly untrue: 1) Perl's patterns include full Unicode 
support, and 2) XML Schema uses a small subset of them.

Robin Berjon <robin.berjon@expway.fr>
Research Engineer, Expway        http://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488
Received on Tuesday, 1 July 2003 11:19:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:02 UTC