[whatwg] Vagueness in description of pattern attribute

Brad Fults bfults at gmail.com
Tue Dec 14 15:55:46 PST 2004


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



More information about the whatwg mailing list