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

[whatwg] Web Forms 2.0 patterns...

From: Steve Webster <steve@dynamicflash.co.uk>
Date: Mon, 13 Dec 2004 01:25:47 +0000
Message-ID: <41BCEF9B.7020007@dynamicflash.co.uk>
Hi folks,

Firstly, this is my first post to this list and I'm not sure if I'm 
violating any kind of list etiquette by just posting straight out. I'm 
just a meager web developer, so I'm not even sure that I have any right 
to be commenting on this specification, but I thought I'd give it a go.

I'm concerned about the implicit start-of- and end-of-string anchors 
that are to be applied to a pattern. While I appreciate that the 
majority of use cases would likely require exact user input matching, I 
would argue that developers could not reasonably anticipate that these 
anchors would be applied. Indeed, I can think of no other implementation 
of regular expressions that operates in this way, and I fear that this 
will only serve to confuse developers already familiar with other 
regular expression implementations.

It could also be argued that developers who might use such an advanced 
feature are likely to also have good knowledge of (and be using patterns 
in conjunction with) ECMAScript and its regular expressions, which do 
not work in the same way as the proposed pattern attribute would.

I feel that the justification given in the specification for these 
implicit anchors - chiefly that it is easier to pick up an error in your 
pattern when anchors are implicitly added - is a little optimistic. It 
means that the regular expression you see in the source code is no 
longer a true representation of what will be fed to the regular 
expression engine, and without prior knowledge that these anchors are 
implicitly added (and with no realistic hope of browser debug 
information on how it parsed the pattern) many developers would be left 
confused as to why their regular expression works in ECMAScript but not 
in their web form.

As I said at the start, this is my first post to this list, so please be 
gentle with me :o)

Cheers,

Steve
Received on Sunday, 12 December 2004 17:25:47 UTC

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