[whatwg] Web Forms 2.0 Substantial - Section 2

Hallvord Reiar Michaelsen Steen hallvors at online.no
Wed Jun 23 08:47:03 PDT 2004


On 22 Jun 2004 at 12:42, Ian Hickson wrote:

> > 2.9. The pattern attribute
> > --------------------------
> >
> > # If the attribute is empty or omitted then it is equivalent to .* 
> > # (which, with the implied start and end characters, becomes ^.*$),
> > # which matches anything.
> >
> > I'm not too familiar with the details of ECMA regex, but I believe that
> > pattern excludes newlines, which you do not want to do for <textarea>.
> 
> Good point. I used a regular expression pattern you hate instead...

But the spec already says 
"The pattern must be compiled with the multiline flag enabled (see 
ECMA262, section 15.10.7.4)."

This means that periods DO match newlines.

javascript:alert(/^.*$/m.test('multiple \n\n lines \n\n here'))

I suggest you revert this section to the old .* syntax, it is much 
simpler. (Unless of course the multiline flag requirement may be 
taken out..)
-- 
Hallvord Reiar Michaelsen Steen
hallvors at online.no / www.hallvord.com




More information about the whatwg mailing list