W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: Is <pattern value="(.)+\.(gif|jpg|jpeg|bmp)"/> allowed?

From: Stanley Guan <Stanley.Guan@oracle.com>
Date: Wed, 17 Oct 2001 11:33:50 -0700
Message-ID: <3BCDCF0E.1DB399EC@oracle.com>
To: Ross Thompson <rthompson@contivo.com>, xmlschema-dev@w3.org
Ross,

Actually, it can be more succinctly represented as:
  ".+"
because "." will match the rest of the pattern string.

My point is:
  For the particles, they are subject to ambiguity constraints (
  Unique Attribution ($3.8.6)).  For example, if an instance
   element could match either an explicit particle and a wildcard
   that model is in error.

Do we have something similar to Unique Attribution for patterns?
In my original posting, there was a typo.  The better specification
is
   <pattern value="[^\.]+\.(gif|jpg|jpeg|bmp)"/>

which is not ambiguous.  And I don't think most of the schema
processor will try to roll back and find a better matching as described
in Kongyi's response!

-Stanley

Ross Thompson wrote:

> Stanley Guan writes:
>  > Hi,
>  >
>  > Please see the following discussions for details.  But, is the
>  > following regular expression allowed?
>  >     <pattern value="(.)+\.(gif|jpg|jpeg|bmp)"/>
>
> Yes it's allowed.  It could be expressed slightly more simply as
>
>     <pattern value=".+\.(gif|jpg|jpeg|bmp)"/>
>
> which is exactly equivalent.
>
> - Ross
>
> ---
> Withough 'g-o-d', 'good' would be 'o'   -- unknown
Received on Wednesday, 17 October 2001 14:34:28 GMT

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