W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2006

[whatwg] alternatives/grouping in pattern attributes in Web Forms

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 15 Aug 2006 09:55:00 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0608150952110.5340@dhalsim.dreamhost.com>
On Fri, 14 Apr 2006 mqmq87 at web.de wrote:
>
> This text in section 2.6 doesn't seem to consider alternatives and grouping:
> 
> | 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 (unless the characters are escaped or
> | part of a range).
> 
> This is wrong (and what means "range"? should this read "CharacterClass"?).
> In pattern="[0-9]+$|^0[xX][0-9a-fA-F]+" they would be even required to prevent
> matching "123xyz", "abc0x0" or similar values, unless the whole string is
> enclosed in parentheses.
> 
> More intuitive would be an implicit enclosure of the attribute value between
> "^(?:" and ")$" instead of plain ^ and $ to construct the actual regular
> expression.

In response to earlier comments I changed this to not work by "fixing up" 
the regexp but by explicitly requiring the regexp to match the entire 
string. I've gone ahead and just removed the paragraph you quote above as 
it is just confusing and wrong (as you point out).

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 15 August 2006 02:55:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:28 UTC