Skip to content

Commit

Permalink
[giow] (3) Update to e-mail syntax checking for better compliance wit…
Browse files Browse the repository at this point in the history
…h the relevant RFCs.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=19117
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@7770 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 25, 2013
1 parent 456b840 commit aa0cfee
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 19 deletions.
21 changes: 16 additions & 5 deletions complete.html
Expand Up @@ -46359,10 +46359,17 @@ <h6 id="e-mail-state-(type=email)"><span class=secno>4.10.7.1.5 </span><dfn titl

</dd>

</dl><p>A <dfn id=valid-e-mail-address>valid e-mail address</dfn> is a string that matches the ABNF production <code title="">1*(&nbsp;atext&nbsp;/&nbsp;"."&nbsp;)&nbsp;"@"&nbsp;ldh-str&nbsp;*(&nbsp;"."&nbsp;ldh-str&nbsp;)</code>
where <code title="">atext</code> is defined in <a href=http://tools.ietf.org/html/rfc5322#section-3.2.3>RFC 5322 section 3.2.3</a>, and <code title="">ldh-str</code> is defined in <a href=http://tools.ietf.org/html/rfc1034#section-3.5>RFC
1034 section 3.5</a>. <a href=#refsABNF>[ABNF]</a> <a href=#refsRFC5322>[RFC5322]</a> <a href=#refsRFC1034>[RFC1034]</a></p> <!-- Domain syntax based on section 3.5 of [RFC1034] and
section 2.1 of [RFC1123] -->
</dl><p>A <dfn id=valid-e-mail-address>valid e-mail address</dfn> is a string that matches the <code title="">email</code>
production of the following ABNF, the character set for which is Unicode. This ABNF implements the
extensions described in RFC 1123. <a href=#refsABNF>[ABNF]</a> <a href=#refsRFC5322>[RFC5322]</a> <a href=#refsRFC1034>[RFC1034]</a> <a href=#refsRFC1123>[RFC1123]</a></p>

<pre>email = 1*( atext / "." ) "@" label *( "." label )
label = let-dig [ [ ldh-str ] let-dig ] ; limited to a length of 255 characters by <a href=http://tools.ietf.org/html/rfc1123#section-2>RFC 1123 section 2.1</a>
atext = &lt; as defined in <a href=http://tools.ietf.org/html/rfc5322#section-3.2.3>RFC 5322 section 3.2.3</a> &gt;
let-dig = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#section-3.5>RFC 1034 section 3.5</a> &gt;
ldh-str = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#section-3.5>RFC 1034 section 3.5</a> &gt;</pre>

<!-- Domain syntax based on section 3.5 of [RFC1034] and section 2.1 of [RFC1123] -->

<p class=note>This requirement is a <a href=#willful-violation>willful violation</a> of RFC 5322, which defines a
syntax for e-mail addresses that is simultaneously too strict (before the "@" character), too
Expand All @@ -46378,7 +46385,7 @@ <h6 id="e-mail-state-(type=email)"><span class=secno>4.10.7.1.5 </span><dfn titl
<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>
<pre>/^[a-zA-Z0-9.!#$%&amp;'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$/</pre>

<!-- based on: http://blog.gerv.net/2011/05/html5_email_address_regexp/ -->

Expand Down Expand Up @@ -101098,6 +101105,9 @@ <h2 class=no-num id=references>References</h2><!--REFS-->
<dt id=refsRFC1034>[RFC1034]</dt>
<dd><cite><a href=http://tools.ietf.org/html/rfc1034>Domain Names - Concepts and Facilities</a></cite>, P. Mockapetris. IETF, November 1987.</dd>

<dt id=refsRFC1123>[RFC1123]</dt>
<dd><cite><a href=http://tools.ietf.org/html/rfc1123>Requirements for Internet Hosts -- Application and Support</a></cite>, R. Braden. IETF, October 1989.</dd>

<dt id=refsRFC1345>[RFC1345]</dt>
<dd><cite><a href=http://tools.ietf.org/html/rfc1345>Character Mnemonics and Character Sets</a></cite>, K. Simonsen. IETF.</dd>

Expand Down Expand Up @@ -101691,6 +101701,7 @@ <h2 class=no-num id=references>References</h2><!--REFS-->
Maik Merten,
Malcolm Rowe,
Manish Tripathi,
Marcus Bointon,
Mark Birbeck,
Mark Davis,
Mark Miller,
Expand Down
21 changes: 16 additions & 5 deletions index
Expand Up @@ -46359,10 +46359,17 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H

</dd>

</dl><p>A <dfn id=valid-e-mail-address>valid e-mail address</dfn> is a string that matches the ABNF production <code title="">1*(&nbsp;atext&nbsp;/&nbsp;"."&nbsp;)&nbsp;"@"&nbsp;ldh-str&nbsp;*(&nbsp;"."&nbsp;ldh-str&nbsp;)</code>
where <code title="">atext</code> is defined in <a href=http://tools.ietf.org/html/rfc5322#section-3.2.3>RFC 5322 section 3.2.3</a>, and <code title="">ldh-str</code> is defined in <a href=http://tools.ietf.org/html/rfc1034#section-3.5>RFC
1034 section 3.5</a>. <a href=#refsABNF>[ABNF]</a> <a href=#refsRFC5322>[RFC5322]</a> <a href=#refsRFC1034>[RFC1034]</a></p> <!-- Domain syntax based on section 3.5 of [RFC1034] and
section 2.1 of [RFC1123] -->
</dl><p>A <dfn id=valid-e-mail-address>valid e-mail address</dfn> is a string that matches the <code title="">email</code>
production of the following ABNF, the character set for which is Unicode. This ABNF implements the
extensions described in RFC 1123. <a href=#refsABNF>[ABNF]</a> <a href=#refsRFC5322>[RFC5322]</a> <a href=#refsRFC1034>[RFC1034]</a> <a href=#refsRFC1123>[RFC1123]</a></p>

<pre>email = 1*( atext / "." ) "@" label *( "." label )
label = let-dig [ [ ldh-str ] let-dig ] ; limited to a length of 255 characters by <a href=http://tools.ietf.org/html/rfc1123#section-2>RFC 1123 section 2.1</a>
atext = &lt; as defined in <a href=http://tools.ietf.org/html/rfc5322#section-3.2.3>RFC 5322 section 3.2.3</a> &gt;
let-dig = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#section-3.5>RFC 1034 section 3.5</a> &gt;
ldh-str = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#section-3.5>RFC 1034 section 3.5</a> &gt;</pre>

<!-- Domain syntax based on section 3.5 of [RFC1034] and section 2.1 of [RFC1123] -->

<p class=note>This requirement is a <a href=#willful-violation>willful violation</a> of RFC 5322, which defines a
syntax for e-mail addresses that is simultaneously too strict (before the "@" character), too
Expand All @@ -46378,7 +46385,7 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<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>
<pre>/^[a-zA-Z0-9.!#$%&amp;'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$/</pre>

<!-- based on: http://blog.gerv.net/2011/05/html5_email_address_regexp/ -->

Expand Down Expand Up @@ -101098,6 +101105,9 @@ if (s = prompt('What is your name?')) {
<dt id=refsRFC1034>[RFC1034]</dt>
<dd><cite><a href=http://tools.ietf.org/html/rfc1034>Domain Names - Concepts and Facilities</a></cite>, P. Mockapetris. IETF, November 1987.</dd>

<dt id=refsRFC1123>[RFC1123]</dt>
<dd><cite><a href=http://tools.ietf.org/html/rfc1123>Requirements for Internet Hosts -- Application and Support</a></cite>, R. Braden. IETF, October 1989.</dd>

<dt id=refsRFC1345>[RFC1345]</dt>
<dd><cite><a href=http://tools.ietf.org/html/rfc1345>Character Mnemonics and Character Sets</a></cite>, K. Simonsen. IETF.</dd>

Expand Down Expand Up @@ -101691,6 +101701,7 @@ if (s = prompt('What is your name?')) {
Maik Merten,
Malcolm Rowe,
Manish Tripathi,
Marcus Bointon,
Mark Birbeck,
Mark Davis,
Mark Miller,
Expand Down
27 changes: 18 additions & 9 deletions source
Expand Up @@ -55606,14 +55606,19 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {

</dl>

<p>A <dfn>valid e-mail address</dfn> is a string that matches the ABNF production <code
title="">1*(&nbsp;atext&nbsp;/&nbsp;"."&nbsp;)&nbsp;"@"&nbsp;ldh-str&nbsp;*(&nbsp;"."&nbsp;ldh-str&nbsp;)</code>
where <code title="">atext</code> is defined in <a
href="http://tools.ietf.org/html/rfc5322#section-3.2.3">RFC 5322 section 3.2.3</a>, and <code
title="">ldh-str</code> is defined in <a href="http://tools.ietf.org/html/rfc1034#section-3.5">RFC
1034 section 3.5</a>. <a href="#refsABNF">[ABNF]</a> <a href="#refsRFC5322">[RFC5322]</a> <a
href="#refsRFC1034">[RFC1034]</a></p> <!-- Domain syntax based on section 3.5 of [RFC1034] and
section 2.1 of [RFC1123] -->
<p>A <dfn>valid e-mail address</dfn> is a string that matches the <code title="">email</code>
production of the following ABNF, the character set for which is Unicode. This ABNF implements the
extensions described in RFC 1123. <a href="#refsABNF">[ABNF]</a> <a
href="#refsRFC5322">[RFC5322]</a> <a href="#refsRFC1034">[RFC1034]</a> <a
href="#refsRFC1123">[RFC1123]</a></p>

<pre>email = 1*( atext / "." ) "@" label *( "." label )
label = let-dig [ [ ldh-str ] let-dig ] ; limited to a length of 255 characters by <a href="http://tools.ietf.org/html/rfc1123#section-2">RFC 1123 section 2.1</a>
atext = &lt; as defined in <a href="http://tools.ietf.org/html/rfc5322#section-3.2.3">RFC 5322 section 3.2.3</a> >
let-dig = &lt; as defined in <a href="http://tools.ietf.org/html/rfc1034#section-3.5">RFC 1034 section 3.5</a> >
ldh-str = &lt; as defined in <a href="http://tools.ietf.org/html/rfc1034#section-3.5">RFC 1034 section 3.5</a> ></pre>

<!-- Domain syntax based on section 3.5 of [RFC1034] and section 2.1 of [RFC1123] -->

<p class="note">This requirement is a <span>willful violation</span> of RFC 5322, which defines a
syntax for e-mail addresses that is simultaneously too strict (before the "@" character), too
Expand All @@ -55629,7 +55634,7 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
<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>
<pre>/^[a-zA-Z0-9.!#$%&amp;'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$/</pre>

<!-- based on: http://blog.gerv.net/2011/05/html5_email_address_regexp/ -->

Expand Down Expand Up @@ -118240,6 +118245,9 @@ if (s = prompt('What is your name?')) {
<dt id="refsRFC1034">[RFC1034]</dt>
<dd><cite><a href="http://tools.ietf.org/html/rfc1034">Domain Names - Concepts and Facilities</a></cite>, P. Mockapetris. IETF, November 1987.</dd>

<dt id="refsRFC1123">[RFC1123]</dt>
<dd><cite><a href="http://tools.ietf.org/html/rfc1123">Requirements for Internet Hosts -- Application and Support</a></cite>, R. Braden. IETF, October 1989.</dd>

<dt id="refsRFC1321">[RFC1321]</dt>
<dd><cite><a href="http://tools.ietf.org/html/rfc1321">The MD5 Message-Digest Algorithm</a></cite>, R. Rivest. IETF.</dd>

Expand Down Expand Up @@ -118922,6 +118930,7 @@ if (s = prompt('What is your name?')) {
Maik Merten,
Malcolm Rowe,
Manish Tripathi,
Marcus Bointon,
Mark Birbeck,
Mark Davis,
Mark Miller,
Expand Down

0 comments on commit aa0cfee

Please sign in to comment.