HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/6884

File a bug

SVNBugCommentTime (UTC)
6884Add a note about how to implement type=email checking with a regular expression.2012-01-10 00:56
Index: source
===================================================================
--- source	(revision 6883)
+++ source	(revision 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.!#$%&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

|