Permalink
Browse files

[e] (0) Add a note about how to implement type=email checking with a …

…regular expression.

Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@6884 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent a53b83b commit 0763c41e92520446402894536062a11a1b2a39e4 @Hixie Hixie committed Jan 10, 2012
Showing with 48 additions and 0 deletions.
  1. +16 −0 complete.html
  2. +16 −0 index
  3. +16 −0 source
View
@@ -44254,6 +44254,22 @@ <h6 id="e-mail-state-(type=email)"><span class=secno>4.10.7.1.5 </span><dfn titl
whitespace characters, and quoted strings in manners unfamiliar to
most users) to be of practical use here.</p>
+ <div class=note>
+
+ <!--<p><i>This note, like all notes, is
+ non-normative. In case of a conflict between this note and the
+ above definition, the above definition takes precedence. Please
+ report any such inconsistencies!</i></p>-->
+
+ <p>The following JavaScript- and Perl-compatible regular expression
+ is an implementation of the above definition.</p>
+
+ <pre>/^[a-zA-Z0-9.!#$%&amp;'*+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/</pre>
+
+ <!-- based on: http://blog.gerv.net/2011/05/html5_email_address_regexp/ -->
+
+ </div>
+
<p>A <dfn id=valid-e-mail-address-list>valid e-mail address list</dfn> is a <a href=#set-of-comma-separated-tokens>set of
comma-separated tokens</a>, where each token is itself a
<a href=#valid-e-mail-address>valid e-mail address</a>. <span class=impl>To obtain the
View
@@ -44254,6 +44254,22 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
whitespace characters, and quoted strings in manners unfamiliar to
most users) to be of practical use here.</p>
+ <div class=note>
+
+ <!--<p><i>This note, like all notes, is
+ non-normative. In case of a conflict between this note and the
+ above definition, the above definition takes precedence. Please
+ report any such inconsistencies!</i></p>-->
+
+ <p>The following JavaScript- and Perl-compatible regular expression
+ is an implementation of the above definition.</p>
+
+ <pre>/^[a-zA-Z0-9.!#$%&amp;'*+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/</pre>
+
+ <!-- based on: http://blog.gerv.net/2011/05/html5_email_address_regexp/ -->
+
+ </div>
+
<p>A <dfn id=valid-e-mail-address-list>valid e-mail address list</dfn> is a <a href=#set-of-comma-separated-tokens>set of
comma-separated tokens</a>, where each token is itself a
<a href=#valid-e-mail-address>valid e-mail address</a>. <span class=impl>To obtain the
View
@@ -51637,6 +51637,22 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
whitespace characters, and quoted strings in manners unfamiliar to
most users) to be of practical use here.</p>
+ <div class="note">
+
+ <!--END dev-html--><!--<p><i>This note, like all notes, is
+ non-normative. In case of a conflict between this note and the
+ above definition, the above definition takes precedence. Please
+ report any such inconsistencies!</i></p>--><!--START dev-html-->
+
+ <p>The following JavaScript- and Perl-compatible regular expression
+ is an implementation of the above definition.</p>
+
+ <pre>/^[a-zA-Z0-9.!#$%&amp;'*+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/</pre>
+
+ <!-- based on: http://blog.gerv.net/2011/05/html5_email_address_regexp/ -->
+
+ </div>
+
<p>A <dfn>valid e-mail address list</dfn> is a <span>set of
comma-separated tokens</span>, where each token is itself a
<span>valid e-mail address</span>. <span class="impl">To obtain the

0 comments on commit 0763c41

Please sign in to comment.