W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2004

[whatwg] Vagueness in description of pattern attribute

From: Brad Fults <bfults@gmail.com>
Date: Tue, 14 Dec 2004 15:55:46 -0800
Message-ID: <1959130b041214155568106a15@mail.gmail.com>
In the WF 2.0 CFC [1], the pattern attribute is described and included
is this paragraph:

"The ^ and $ characters have their usual meaning. Thus, using the ^
character anywhere other than at the start of the pattern, or the $
character anywhere other than at the end of the pattern, prevents the
pattern from matching anything."

That is obviously untrue in at least four cases.

 1. When ^ is used at the beginning of a char class. e.g. pattern="[^abc]"
 2. When ^ is used anywhere else in a char class. e.g. pattern="[asdf^!]"
 3. When ^ is escaped by \. e.g. pattern="\^.*"
 4. When $ is escaped by \. e.g. pattern="\$.*"

In addition, following my understanding, the ^ and $ are implied and
thus including ^ at the beginning or $ at the end would be erroneous.
I suppose that's a fifth reason why that paragraph is incorrect.

I figure as long as things are being specified, any ambiguity and
vagueness should be eliminated.

[1] - http://www.whatwg.org/specs/web-forms/2004-12-10-call-for-comments/#the-pattern

-- 
Brad Fults
NeatBox
Received on Tuesday, 14 December 2004 15:55:46 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:38 UTC