<?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: How to validate an Email address with Regex &amp; PHP -update</title>
	<atom:link href="http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/</link>
	<description>by Jeroen Op &#039;t Eynde</description>
	<lastBuildDate>Tue, 08 Sep 2009 18:34:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jeroen</title>
		<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/comment-page-1/#comment-4888</link>
		<dc:creator>Jeroen</dc:creator>
		<pubDate>Tue, 08 Sep 2009 18:34:36 +0000</pubDate>
		<guid isPermaLink="false">http://xprsyrslf.be/?p=419#comment-4888</guid>
		<description>I think you don&#039;t understand the code fully, &lt;a href=&quot;http://us3.php.net/manual/en/function.checkdnsrr.php&quot; rel=&quot;nofollow&quot;&gt;checkdnsrr()&lt;/a&gt; doesn&#039;t ask the MX servers anything, it just checks if they exist.

The regex is tested against various, maybe any kind of (un)existing email addresses, please check the references. &#039;I haven&#039;t read it&#039; is not an excuse. I know about the 6400+ character regex as stated two comments above yours, including my opinion on the matter.

Indeed, checking the email with a click through routine is the only way to see if it is valid, but do you want to do that every time you fill in your email somewhere, like for this comment?</description>
		<content:encoded><![CDATA[<p>I think you don&#8217;t understand the code fully, <a href="http://us3.php.net/manual/en/function.checkdnsrr.php" rel="nofollow">checkdnsrr()</a> doesn&#8217;t ask the MX servers anything, it just checks if they exist.</p>
<p>The regex is tested against various, maybe any kind of (un)existing email addresses, please check the references. &#8216;I haven&#8217;t read it&#8217; is not an excuse. I know about the 6400+ character regex as stated two comments above yours, including my opinion on the matter.</p>
<p>Indeed, checking the email with a click through routine is the only way to see if it is valid, but do you want to do that every time you fill in your email somewhere, like for this comment?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Lynch</title>
		<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/comment-page-1/#comment-4843</link>
		<dc:creator>Richard Lynch</dc:creator>
		<pubDate>Tue, 08 Sep 2009 17:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://xprsyrslf.be/?p=419#comment-4843</guid>
		<description>MX servers will lie.  A lot.  It&#039;s pretty pointless to ask them.
If you want to be sure it&#039;s valid, send an email and make the user click through.

Your Regex is wrong.  I haven&#039;t read it, but the *right* regex is THREE PAGES LONG.  So yours is wrong.

Try using the imap_rfc882 function to parse the emails, and then check that you got valid fields back from that.</description>
		<content:encoded><![CDATA[<p>MX servers will lie.  A lot.  It&#8217;s pretty pointless to ask them.<br />
If you want to be sure it&#8217;s valid, send an email and make the user click through.</p>
<p>Your Regex is wrong.  I haven&#8217;t read it, but the *right* regex is THREE PAGES LONG.  So yours is wrong.</p>
<p>Try using the imap_rfc882 function to parse the emails, and then check that you got valid fields back from that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeroen</title>
		<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/comment-page-1/#comment-4217</link>
		<dc:creator>Jeroen</dc:creator>
		<pubDate>Mon, 07 Sep 2009 22:03:43 +0000</pubDate>
		<guid isPermaLink="false">http://xprsyrslf.be/?p=419#comment-4217</guid>
		<description>A little update on the function so PHP doesn&#039;t trow E_NOTICE</description>
		<content:encoded><![CDATA[<p>A little update on the function so PHP doesn&#8217;t trow E_NOTICE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeroen</title>
		<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/comment-page-1/#comment-3535</link>
		<dc:creator>Jeroen</dc:creator>
		<pubDate>Sun, 06 Sep 2009 11:39:28 +0000</pubDate>
		<guid isPermaLink="false">http://xprsyrslf.be/?p=419#comment-3535</guid>
		<description>Interesting extension, but I think it is not always available or you just don&#039;t have the choice like with  shared hosting.
If you still want to use this validation when the extension is not available, you have to load in a regex of 6400+ characters, which is sometimes longer than the code were it is needed. (http://ex-parrot.com/~pdw/Mail-RFC822-Address.html)
Therefore, if you take out the TLDs, it is not maintenance-impossible and you will check if the MX record exists for the domain with the checkdnsrr().
I guess it depends on the possibilities you have and what you prefer.</description>
		<content:encoded><![CDATA[<p>Interesting extension, but I think it is not always available or you just don&#8217;t have the choice like with  shared hosting.<br />
If you still want to use this validation when the extension is not available, you have to load in a regex of 6400+ characters, which is sometimes longer than the code were it is needed. (<a href="http://ex-parrot.com/~pdw/Mail-RFC822-Address.html" rel="nofollow">http://ex-parrot.com/~pdw/Mail-RFC822-Address.html</a>)<br />
Therefore, if you take out the TLDs, it is not maintenance-impossible and you will check if the MX record exists for the domain with the checkdnsrr().<br />
I guess it depends on the possibilities you have and what you prefer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Dickey</title>
		<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/comment-page-1/#comment-1906</link>
		<dc:creator>Jeff Dickey</dc:creator>
		<pubDate>Fri, 04 Sep 2009 14:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://xprsyrslf.be/?p=419#comment-1906</guid>
		<description>Just make sure you leave this nailed up on the wall as *the* definitive anti-pattern for this domain: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address/Mail-RFC822-Address.html

More proof, if any was needed, that perl encourages maintenance-impossible code and reliance on schedulable miracles...</description>
		<content:encoded><![CDATA[<p>Just make sure you leave this nailed up on the wall as *the* definitive anti-pattern for this domain: <a href="http://www.ex-parrot.com/~pdw/Mail-RFC822-Address/Mail-RFC822-Address.html" rel="nofollow">http://www.ex-parrot.com/~pdw/Mail-RFC822-Address/Mail-RFC822-Address.html</a></p>
<p>More proof, if any was needed, that perl encourages maintenance-impossible code and reliance on schedulable miracles&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeroen</title>
		<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/comment-page-1/#comment-1229</link>
		<dc:creator>Jeroen</dc:creator>
		<pubDate>Tue, 01 Sep 2009 17:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://xprsyrslf.be/?p=419#comment-1229</guid>
		<description>Interesting, but it doesn&#039;t validate quiet as much as above regex does. Maybe it is better in performance to use a function like that, but that is not the point here. Otherwise taking both functions together could increase performance after some testing (shorter regex, etc.).

I did a quick test with &lt;a href=&quot;http://blog.tuxz.net/files/test_email.php.txt&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;De Dommelin&#039;s script&lt;/a&gt; and replaced preg_match() with filter_var($v, FILTER_VALIDATE_EMAIL). This is the output and compared to his output of &lt;a href=&quot;http://blog.tuxz.net/archives/2009/03/27/email_validation_using_regular_expression/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;his regex here&lt;/a&gt; (or &lt;a href=&quot;http://fightingforalostcause.net/misc/2006/compare-email-regex.php&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.

Should be VALID :
IPAndPort@127.0.0.1:25 : NOT VALID
&amp;*=?^+{}&#039;~@validCharsInLocal.net : NOT VALID
(these 2 run not valid instead of valid, I can understand that it isn&#039;t allowed by PHP)

Should NOT be VALID :
missingDot@com : VALID
localEndsWithDot.@domain.com : VALID
two..consecutiveDots@domain.com : VALID
TLDDoesntExist@domain.moc : VALID
numbersInTLD@domain.c0m : VALID
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org : VALID</description>
		<content:encoded><![CDATA[<p>Interesting, but it doesn&#8217;t validate quiet as much as above regex does. Maybe it is better in performance to use a function like that, but that is not the point here. Otherwise taking both functions together could increase performance after some testing (shorter regex, etc.).</p>
<p>I did a quick test with <a href="http://blog.tuxz.net/files/test_email.php.txt" target="_blank" rel="nofollow">De Dommelin&#8217;s script</a> and replaced preg_match() with filter_var($v, FILTER_VALIDATE_EMAIL). This is the output and compared to his output of <a href="http://blog.tuxz.net/archives/2009/03/27/email_validation_using_regular_expression/" target="_blank" rel="nofollow">his regex here</a> (or <a href="http://fightingforalostcause.net/misc/2006/compare-email-regex.php" target="_blank" rel="nofollow">here</a>.</p>
<p>Should be VALID :<br />
IPAndPort@127.0.0.1:25 : NOT VALID<br />
&#038;*=?^+{}&#8217;~@validCharsInLocal.net : NOT VALID<br />
(these 2 run not valid instead of valid, I can understand that it isn&#8217;t allowed by PHP)</p>
<p>Should NOT be VALID :<br />
missingDot@com : VALID<br />
<a href="mailto:localEndsWithDot.@domain.com">localEndsWithDot.@domain.com</a> : VALID<br />
<a href="mailto:two..consecutiveDots@domain.com">two..consecutiveDots@domain.com</a> : VALID<br />
<a href="mailto:TLDDoesntExist@domain.moc">TLDDoesntExist@domain.moc</a> : VALID<br />
<a href="mailto:numbersInTLD@domain.c0m">numbersInTLD@domain.c0m</a> : VALID<br />
<a href="mailto:local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org">local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org</a> : VALID</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivo</title>
		<link>http://xprsyrslf.be/2009/08/24/how-to-validate-an-email-address-with-regex-php/comment-page-1/#comment-1124</link>
		<dc:creator>ivo</dc:creator>
		<pubDate>Tue, 01 Sep 2009 13:59:11 +0000</pubDate>
		<guid isPermaLink="false">http://xprsyrslf.be/?p=419#comment-1124</guid>
		<description>check also the php own filter functions to validate a mail address:

http://nl.php.net/manual/en/filter.filters.validate.php</description>
		<content:encoded><![CDATA[<p>check also the php own filter functions to validate a mail address:</p>
<p><a href="http://nl.php.net/manual/en/filter.filters.validate.php" rel="nofollow">http://nl.php.net/manual/en/filter.filters.validate.php</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
