[html5] r6884 - [e] (0) Add a note about how to implement type=email checking with a regular exp [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Jan 9 16:56:17 PST 2012


Author: ianh
Date: 2012-01-09 16:56:16 -0800 (Mon, 09 Jan 2012)
New Revision: 6884

Modified:
   complete.html
   index
   source
Log:
[e] (0) Add a note about how to implement type=email checking with a regular expression.
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2012-01-10 00:09:46 UTC (rev 6883)
+++ complete.html	2012-01-10 00:56:16 UTC (rev 6884)
@@ -44254,6 +44254,22 @@
   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.!#$%&'*+-/=?\^_`{|}~-]+@[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

Modified: index
===================================================================
--- index	2012-01-10 00:09:46 UTC (rev 6883)
+++ index	2012-01-10 00:56:16 UTC (rev 6884)
@@ -44254,6 +44254,22 @@
   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.!#$%&'*+-/=?\^_`{|}~-]+@[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

Modified: source
===================================================================
--- source	2012-01-10 00:09:46 UTC (rev 6883)
+++ source	2012-01-10 00:56:16 UTC (rev 6884)
@@ -51637,6 +51637,22 @@
   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.!#$%&'*+-/=?\^_`{|}~-]+@[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




More information about the Commit-Watchers mailing list