<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: TIP: Simple Regular Expression for Email Validation</title>
	<atom:link href="http://gofedora.com/tip-simple-regular-expressi-email-validation/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>How Tos, Tutorials, Tips and Tricks</description>
	<lastBuildDate>Wed, 01 Jun 2011 05:17:07 +0530</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Frank</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-39712</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Mon, 06 Dec 2010 13:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-39712</guid>
		<description>It worked as a charm :)</description>
		<content:encoded><![CDATA[<p>It worked as a charm <img src='http://gofedora.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjoern</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-34751</link>
		<dc:creator>Bjoern</dc:creator>
		<pubDate>Tue, 14 Sep 2010 13:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-34751</guid>
		<description>Come on, Bernie! Your suggestion is a joke, right? Didn&#039;t think it through, right? Verifying an email your way would mean

1. any email thats not established yet to be invalid.
2. For existing emails your method would be the slowest imagineable and would of course not only
3. lead to unnecessary network traffic, but also to 
4. the requirement of being always connected.</description>
		<content:encoded><![CDATA[<p>Come on, Bernie! Your suggestion is a joke, right? Didn&#8217;t think it through, right? Verifying an email your way would mean</p>
<p>1. any email thats not established yet to be invalid.<br />
2. For existing emails your method would be the slowest imagineable and would of course not only<br />
3. lead to unnecessary network traffic, but also to<br />
4. the requirement of being always connected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-14301</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Tue, 01 Dec 2009 21:50:55 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-14301</guid>
		<description>I wrote a script that compared various regexs from around the web against a set of sample data and the best one I found was:

/^[-_a-z0-9\&#039;+*$^&amp;%=~!?{}]++(?:\.[-_a-z0-9\&#039;+*$^&amp;%=~!?{}]+)*+@(?:(?![-.])[-a-z0-9.]+(?&lt;![-.])\.[a-z]{2,6}&#124;\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD

More details @ &lt;a href=&quot;http://fightingforalostcause.net/misc/2006/compare-email-regex.php&quot;&gt;Comparing E-mail Address Validating Regular Expressions&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I wrote a script that compared various regexs from around the web against a set of sample data and the best one I found was:</p>
<p>/^[-_a-z0-9\'+*$^&amp;%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&amp;%=~!?{}]+)*+@(?:(?![-.])[-a-z0-9.]+(?&lt;![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD</p>
<p>More details @ <a href="http://fightingforalostcause.net/misc/2006/compare-email-regex.php">Comparing E-mail Address Validating Regular Expressions</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CakePHP &#8211; Email Validation &#171; Eureka!</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-5330</link>
		<dc:creator>CakePHP &#8211; Email Validation &#171; Eureka!</dc:creator>
		<pubDate>Fri, 18 Sep 2009 01:32:11 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-5330</guid>
		<description>[...] Reference: TIP: Simple Regular Expression for Email Validation [...]</description>
		<content:encoded><![CDATA[<p>[...] Reference: TIP: Simple Regular Expression for Email Validation [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernie</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-2288</link>
		<dc:creator>Bernie</dc:creator>
		<pubDate>Tue, 18 Aug 2009 15:23:21 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-2288</guid>
		<description>E-mail validation means RFC 5322. If your regex doesn&#039;t match it you are perceived as thus redefining this standard; how angry would you be if you have a valid e-mail address according to the real standard and someone else&#039;s web page tells them they don&#039;t according to their regex?

Here&#039;s what to do.

1. Check there&#039;s a valid MX record for the domain.
2. Do an SMTP call-forward to that domain: connect to the lowest priority MX on port 25 and issue
EHLO my.machine.name[crlf]
MAIL FROM:[crlf]
RCPT TO:[crlf]
RSET
QUIT

Wait for a banner first, and a response each time beginning &quot;2nn &quot;. 

After the RCPT TO, &quot;2nn &quot; means e-mail address deliverable, &quot;4nn &quot; means not currently deliverable, &quot;5nn &quot; means not deliverable. Up to you how you treat &quot;4nn &quot;.

If the above is too difficult, just send them an e-mail containing a token needed to complete whatever your process is. Then not only do you know it&#039;s a valid address, but even that it is the user&#039;s actual address.</description>
		<content:encoded><![CDATA[<p>E-mail validation means RFC 5322. If your regex doesn&#8217;t match it you are perceived as thus redefining this standard; how angry would you be if you have a valid e-mail address according to the real standard and someone else&#8217;s web page tells them they don&#8217;t according to their regex?</p>
<p>Here&#8217;s what to do.</p>
<p>1. Check there&#8217;s a valid MX record for the domain.<br />
2. Do an SMTP call-forward to that domain: connect to the lowest priority MX on port 25 and issue<br />
EHLO my.machine.name[crlf]<br />
MAIL FROM:[crlf]<br />
RCPT TO:[crlf]<br />
RSET<br />
QUIT</p>
<p>Wait for a banner first, and a response each time beginning &#8220;2nn &#8220;. </p>
<p>After the RCPT TO, &#8220;2nn &#8221; means e-mail address deliverable, &#8220;4nn &#8221; means not currently deliverable, &#8220;5nn &#8221; means not deliverable. Up to you how you treat &#8220;4nn &#8220;.</p>
<p>If the above is too difficult, just send them an e-mail containing a token needed to complete whatever your process is. Then not only do you know it&#8217;s a valid address, but even that it is the user&#8217;s actual address.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kulbir Saini</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-2277</link>
		<dc:creator>Kulbir Saini</dc:creator>
		<pubDate>Tue, 18 Aug 2009 09:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-2277</guid>
		<description>@Edward, Tushar Thanks for sharing your regex(s). I&#039;ll test them out.
@Bernie Take it easy dude. I am not defining a standard. I needed a simple regex for email validation in my app and I wrote it. Period.</description>
		<content:encoded><![CDATA[<p>@Edward, Tushar Thanks for sharing your regex(s). I&#8217;ll test them out.<br />
@Bernie Take it easy dude. I am not defining a standard. I needed a simple regex for email validation in my app and I wrote it. Period.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar(Chia)</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-2265</link>
		<dc:creator>Tushar(Chia)</dc:creator>
		<pubDate>Tue, 18 Aug 2009 02:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-2265</guid>
		<description>Here is the Jquery Email verification function 
function isValidEmailAddress(emailAddress) {
  var pattern = new RegExp(/^((&quot;[\w-\s]+&quot;)&#124;([\w-]+(?:\.[\w-]+)*)&#124;(&quot;[\w-\s]+&quot;)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)&#124;(@\[?((25[0-5]\.&#124;2[0-4][0-9]\.&#124;1[0-9]{2}\.&#124;[0-9]{1,2}\.))((25[0-5]&#124;2[0-4][0-9]&#124;1[0-9]{2}&#124;[0-9]{1,2})\.){2}(25[0-5]&#124;2[0-4][0-9]&#124;1[0-9]{2}&#124;[0-9]{1,2})\]?$)/i);
  return pattern.test(emailAddress);
}
Regards</description>
		<content:encoded><![CDATA[<p>Here is the Jquery Email verification function<br />
function isValidEmailAddress(emailAddress) {<br />
  var pattern = new RegExp(/^((&#8221;[\w-\s]+&#8221;)|([\w-]+(?:\.[\w-]+)*)|(&#8221;[\w-\s]+&#8221;)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);<br />
  return pattern.test(emailAddress);<br />
}<br />
Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernie</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-2256</link>
		<dc:creator>Bernie</dc:creator>
		<pubDate>Mon, 17 Aug 2009 21:28:20 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-2256</guid>
		<description>Your regex does not appear to be based on RFC 5322.

What was your source? It looks to me like you&#039;re choosing to reinvent a standard which has carefully been considered by more appropriate people.

This is exactly the sort of thing the F/OSS community accuses proprietary software houses of doing.</description>
		<content:encoded><![CDATA[<p>Your regex does not appear to be based on RFC 5322.</p>
<p>What was your source? It looks to me like you&#8217;re choosing to reinvent a standard which has carefully been considered by more appropriate people.</p>
<p>This is exactly the sort of thing the F/OSS community accuses proprietary software houses of doing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edward Rudd</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-2254</link>
		<dc:creator>Edward Rudd</dc:creator>
		<pubDate>Mon, 17 Aug 2009 21:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-2254</guid>
		<description>Here is my validation Regex which matches a bit more that yours. Specifically emails with apostrophes, which I would prefer not be allowed, but several corporations allow them.  also it only allowed a-z in the domain name.

This regex is designed to run in &quot;case-insensitive mode&quot;

this link was a very nice source of why certain characters that are allowed in the email spec probably shouldn&#039;t and aren&#039;t by most systems.

http://www.remote.org/jochen/mail/info/chars.html

^(?:(?:[\-+%=_&#039;a-z0-9]+)(?:\.(?![\.@]))?)+@(?:[a-z0-9\-]+\.)+[a-z]+

Though personally I like the regex on this page

http://ex-parrot.com/~pdw/Mail-RFC822-Address.html

That&#039;s a good one to scare anyone.</description>
		<content:encoded><![CDATA[<p>Here is my validation Regex which matches a bit more that yours. Specifically emails with apostrophes, which I would prefer not be allowed, but several corporations allow them.  also it only allowed a-z in the domain name.</p>
<p>This regex is designed to run in &#8220;case-insensitive mode&#8221;</p>
<p>this link was a very nice source of why certain characters that are allowed in the email spec probably shouldn&#8217;t and aren&#8217;t by most systems.</p>
<p><a href="http://www.remote.org/jochen/mail/info/chars.html">http://www.remote.org/jochen/mail/info/chars.html</a></p>
<p>^(?:(?:[\-+%=_'a-z0-9]+)(?:\.(?![\.@]))?)+@(?:[a-z0-9\-]+\.)+[a-z]+</p>
<p>Though personally I like the regex on this page</p>
<p><a href="http://ex-parrot.com/~pdw/Mail-RFC822-Address.html">http://ex-parrot.com/~pdw/Mail-RFC822-Address.html</a></p>
<p>That&#8217;s a good one to scare anyone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernie</title>
		<link>http://gofedora.com/tip-simple-regular-expressi-email-validation/comment-page-1/#comment-2253</link>
		<dc:creator>Bernie</dc:creator>
		<pubDate>Mon, 17 Aug 2009 21:19:43 +0000</pubDate>
		<guid isPermaLink="false">http://gofedora.com/?p=667#comment-2253</guid>
		<description>http://en.wikipedia.org/wiki/E-mail_address#RFC_specification</description>
		<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/E-mail_address#RFC_specification">http://en.wikipedia.org/wiki/E-mail_address#RFC_specification</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

