Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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
Hixie committed Jan 10, 2012
1 parent a53b83b commit 0763c41
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions complete.html
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions index
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions source
Expand Up @@ -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
Expand Down

0 comments on commit 0763c41

Please sign in to comment.