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

[whatwg] Web Forms 2.0 Substantial - Section 2

From: Hallvord Reiar Michaelsen Steen <hallvors@online.no>
Date: Wed, 23 Jun 2004 17:47:03 +0200
Message-ID: <40D9C217.20927.5E01FAC@localhost>
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
Received on Wednesday, 23 June 2004 08:47:03 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:34 UTC