[whatwg] Web Forms: pattern attribute

Dean Edwards dean at edwards.name
Mon Apr 3 16:33:05 PDT 2006

Michel Fortin wrote:
> Something about the pattern attribute in Web Forms got me thinking:
>> The regular expression language used for this attribute is the same as 
>> that defined in [ECMA262], except that the pattern attribute implies a 
>> ^ at the start of the pattern and a $ at the end (so the pattern must 
>> match the entire value, not just any subset).
> Does that mean that a pattern attribute like "foo|bar" should translate 
> to /^foo|bar$/ ? Wouldn't it make more sense it it was /^(foo|bar)$/ 
> with the parentesis?

You have a point. Would implied parentheses cause any side effects? None 
that I can think of...


More information about the whatwg mailing list