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

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
   <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!


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 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:54 UTC