[whatwg] Web Forms 2.0 patterns...

Steve Webster lists at codejunkie.co.uk
Sun Dec 12 17:27:23 PST 2004


[Resending from subscribed email account]

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




More information about the whatwg mailing list