[whatwg] Re: Various attributes

Jim Ley jim.ley at gmail.com
Thu Jun 17 01:23:17 PDT 2004


On Wed, 16 Jun 2004 18:57:38 +0100, Malcolm Rowe
<malcolm-what at farside.org.uk> wrote:
> Jim Ley writes:
> >> > Why require the ^ and $ in the regexp, what's the point in the
> >> > restriction?
> >> They are not required; they are implied. The reason is that otherwise
> >> authors would almost always have to add them, which would be the source
> >> of much confusion.
> > I disagree, there's many times where I've been happy with matching a
> > regexp in validation that didn't include the begin and end, and
> > because they are implied, there's no way to not have them, meaning
> > we'd have to have much more complicated regexps.
> 
> I disagree - pattern="[0-9]{4}" is significantly more common than something
> like pattern=".*foo.*", and seriously, how much extra work was the latter?

Oh, right, can Pattern not work on fields that can contain newlines
then, I misunderstood, I thought it could, that's not so useful then.

In any case  "^[0-9]{4}$" and "foo"  were my suggestions, both are
equally simple as the above.

Jim.



More information about the whatwg mailing list