RE: schema pattern matching (negate)

Well done Jeni,

you win a coconut!

I would not want to use this approach for strings that should not begin with
antidisestablishmentarianism though (apologies for spelling).

Is there any chance of an enhancement for this in the next version of
schema?
We can after all force a pattern (or atom of pattern) to match a string and
so a negate of the same would seem a worthwhile enhancement?

Thanks to all who responded,

Colin

-----Original Message-----
From: Jeni Tennison [mailto:jeni@jenitennison.com]
Sent: 01 July 2003 15:59
To: Colin Mackenzie
Cc: xmlschema-dev@w3.org
Subject: Re: schema pattern matching (negate)


Hi Colin,

> but what is required is that pattern does not begin with a whole
> string e.g. "STR1234" and "STRxccc" are bad (because of STR) but
> "SAT1234" and "CARxccc" are good (not beginning with STR).

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.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Tuesday, 1 July 2003 11:10:28 UTC