<?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: Validate email address using JavaScript regular expression</title>
	<atom:link href="http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/</link>
	<description>Effective programming and blogging tips by Zaheer Paracha</description>
	<lastBuildDate>Sat, 11 Feb 2012 03:00:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: dinus</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1950</link>
		<dc:creator>dinus</dc:creator>
		<pubDate>Wed, 08 Feb 2012 15:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1950</guid>
		<description>Hi,
can some one please explain the meaning of below regular expression :
&quot;^([0-9a-zA-Z]([-\\.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$&quot;;

thanks in advance</description>
		<content:encoded><![CDATA[<p>Hi,<br />
can some one please explain the meaning of below regular expression :<br />
&#8220;^([0-9a-zA-Z]([-\\.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$&#8221;;</p>
<p>thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kent</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1949</link>
		<dc:creator>Kent</dc:creator>
		<pubDate>Thu, 02 Feb 2012 21:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1949</guid>
		<description>Does Tank&#039;s address a+anything@gmail.com? It did not seem too. Jerry mentioned this. 

This is a feature at gmail, add a &quot;+(anything you pick)&quot; before the @ on your regular gmail address, and the email will still be delivered to you, but you can send it to special filters.

Modifying Tanks to this
/^[a-zA-Z0-9._\+-]+@[a-zA-Z0-9]+([.-]?[a-zA-Z0-9]+)?([\.]{1}[a-zA-Z]{2,4}){1,4}$/;

Seemed to work.</description>
		<content:encoded><![CDATA[<p>Does Tank&#8217;s address <a href="mailto:a+anything@gmail.com">a+anything@gmail.com</a>? It did not seem too. Jerry mentioned this. </p>
<p>This is a feature at gmail, add a &#8220;+(anything you pick)&#8221; before the @ on your regular gmail address, and the email will still be delivered to you, but you can send it to special filters.</p>
<p>Modifying Tanks to this<br />
/^[a-zA-Z0-9._\+-]+@[a-zA-Z0-9]+([.-]?[a-zA-Z0-9]+)?([\.]{1}[a-zA-Z]{2,4}){1,4}$/;</p>
<p>Seemed to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tory</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1924</link>
		<dc:creator>Tory</dc:creator>
		<pubDate>Tue, 24 Jan 2012 18:13:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1924</guid>
		<description>The solution Tank gave seems to pass all my tests and it&#039;s a one liner. Thanks Tank</description>
		<content:encoded><![CDATA[<p>The solution Tank gave seems to pass all my tests and it&#8217;s a one liner. Thanks Tank</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rashid</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1921</link>
		<dc:creator>Rashid</dc:creator>
		<pubDate>Sun, 22 Jan 2012 07:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1921</guid>
		<description>ya zaheer paratha koon ha?????</description>
		<content:encoded><![CDATA[<p>ya zaheer paratha koon ha?????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John K</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1887</link>
		<dc:creator>John K</dc:creator>
		<pubDate>Sat, 31 Dec 2011 20:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1887</guid>
		<description>here&#039;s the regex modified to accept + signs after the first character of the address:

/^[a-z0-9._\-][a-z0-9._\-\+]*@[a-z0-9][a-z0-9.\-]*[\.]{1}[a-z]{2,4}$/i

I also shortened it by adding i modifier at end, so don&#039;t need to specify A-Z for uppercase letters. The regex still has false positives, no doubt, but no false negatives for + signs.</description>
		<content:encoded><![CDATA[<p>here&#8217;s the regex modified to accept + signs after the first character of the address:</p>
<p>/^[a-z0-9._\-][a-z0-9._\-\+]*@[a-z0-9][a-z0-9.\-]*[\.]{1}[a-z]{2,4}$/i</p>
<p>I also shortened it by adding i modifier at end, so don&#8217;t need to specify A-Z for uppercase letters. The regex still has false positives, no doubt, but no false negatives for + signs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Johnstone</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1856</link>
		<dc:creator>Jeremy Johnstone</dc:creator>
		<pubDate>Fri, 16 Dec 2011 17:31:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1856</guid>
		<description>This regex has so many flaws I have to heavily recommend everyone ignore it. Worse than the numerous false positives others have already pointed out, it also regexs common perfectly valid email addresses. For example, the + character is very valid and not super uncommon in the left hand side of an email address.

Buyer beware, you get what you pay for when you use this regex!</description>
		<content:encoded><![CDATA[<p>This regex has so many flaws I have to heavily recommend everyone ignore it. Worse than the numerous false positives others have already pointed out, it also regexs common perfectly valid email addresses. For example, the + character is very valid and not super uncommon in the left hand side of an email address.</p>
<p>Buyer beware, you get what you pay for when you use this regex!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mardi</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1851</link>
		<dc:creator>Mardi</dc:creator>
		<pubDate>Thu, 15 Dec 2011 09:19:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1851</guid>
		<description>Hi 

I am VERY new too Javascript and need to validate a form for a tafe assignment. So far I have added code to validate required text fields and a drop down menu and  have all the error messages come up in the one alert box. Now I am having trouble figuring out how to add the code to validate an email and have the error message appear in the same alert box as they are other fields are being validated. I hope I am making sense!! 

If anyone is able to help this is my code! Please ignore all the comments! I have to add them as parrt of the assignment

    function checkforblank() {

    var errormessage = &quot;&quot;;

	if (document.getElementById(&#039;selectmenu&#039;).value == &quot;&quot;) {
	/* the getElementById is determined by the id given in the below html.
	For example:  */
    errormessage += &quot;Please specify your title \n \n&quot;;
    document.getElementById (&#039;selectmenu&#039;).style.borderColor = &quot;red&quot;;
    /* .style.borderColor highlights the borders of the text fields in red when there is an error */
    	}
    if (document.getElementById(&#039;fname&#039;).value == &quot;&quot;) {
    errormessage += &quot;Please enter your first name \n \n&quot;;
    /* error message if first name field is not filled out */
    document.getElementById (&#039;fname&#039;).style.borderColor = &quot;red&quot;;
    	}
    if (document.getElementById(&#039;lname&#039;).value == &quot;&quot;) {
    errormessage += &quot;Please enter your last name \n \n&quot;;
     /* error message if last name field is not filled out */
    document.getElementById (&#039;lname&#039;).style.borderColor = &quot;red&quot;;
    	}
    if (document.getElementById(&#039;enquiry&#039;).value == &quot;&quot;) {
    errormessage += &quot;Please submit an enquiry \n \n&quot;;
     /* error message if viewer does not enter an enquiry */
    document.getElementById (&#039;enquiry&#039;).style.borderColor = &quot;red&quot;;
    	}
    if (errormessage != &quot;&quot;) {
    alert (errormessage);
/* alert (errormessage) displays the specified error messages that were created in the
above if statements */
    return false;
    	}
/* return false stops the form from being submitted to the server */
    // End of function


    }</description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>I am VERY new too Javascript and need to validate a form for a tafe assignment. So far I have added code to validate required text fields and a drop down menu and  have all the error messages come up in the one alert box. Now I am having trouble figuring out how to add the code to validate an email and have the error message appear in the same alert box as they are other fields are being validated. I hope I am making sense!! </p>
<p>If anyone is able to help this is my code! Please ignore all the comments! I have to add them as parrt of the assignment</p>
<p>    function checkforblank() {</p>
<p>    var errormessage = &#8220;&#8221;;</p>
<p>	if (document.getElementById(&#8216;selectmenu&#8217;).value == &#8220;&#8221;) {<br />
	/* the getElementById is determined by the id given in the below html.<br />
	For example:  */<br />
    errormessage += &#8220;Please specify your title \n \n&#8221;;<br />
    document.getElementById (&#8216;selectmenu&#8217;).style.borderColor = &#8220;red&#8221;;<br />
    /* .style.borderColor highlights the borders of the text fields in red when there is an error */<br />
    	}<br />
    if (document.getElementById(&#8216;fname&#8217;).value == &#8220;&#8221;) {<br />
    errormessage += &#8220;Please enter your first name \n \n&#8221;;<br />
    /* error message if first name field is not filled out */<br />
    document.getElementById (&#8216;fname&#8217;).style.borderColor = &#8220;red&#8221;;<br />
    	}<br />
    if (document.getElementById(&#8216;lname&#8217;).value == &#8220;&#8221;) {<br />
    errormessage += &#8220;Please enter your last name \n \n&#8221;;<br />
     /* error message if last name field is not filled out */<br />
    document.getElementById (&#8216;lname&#8217;).style.borderColor = &#8220;red&#8221;;<br />
    	}<br />
    if (document.getElementById(&#8216;enquiry&#8217;).value == &#8220;&#8221;) {<br />
    errormessage += &#8220;Please submit an enquiry \n \n&#8221;;<br />
     /* error message if viewer does not enter an enquiry */<br />
    document.getElementById (&#8216;enquiry&#8217;).style.borderColor = &#8220;red&#8221;;<br />
    	}<br />
    if (errormessage != &#8220;&#8221;) {<br />
    alert (errormessage);<br />
/* alert (errormessage) displays the specified error messages that were created in the<br />
above if statements */<br />
    return false;<br />
    	}<br />
/* return false stops the form from being submitted to the server */<br />
    // End of function</p>
<p>    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Multiple email</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1842</link>
		<dc:creator>Multiple email</dc:creator>
		<pubDate>Tue, 13 Dec 2011 11:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1842</guid>
		<description>This RegEx allows multiple email addresses if it is separated by a &quot;;&quot;
In a textbox if i need to validate a single email address and if two addresses are entered then this RegEx wont work.</description>
		<content:encoded><![CDATA[<p>This RegEx allows multiple email addresses if it is separated by a &#8220;;&#8221;<br />
In a textbox if i need to validate a single email address and if two addresses are entered then this RegEx wont work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hak</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1774</link>
		<dc:creator>hak</dc:creator>
		<pubDate>Thu, 24 Nov 2011 08:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1774</guid>
		<description>what if someone inputs &#039;joe@support.com.com&#039; 

or @.edu.edu

??</description>
		<content:encoded><![CDATA[<p>what if someone inputs &#8216;joe@support.com.com&#8217; </p>
<p>or @.edu.edu</p>
<p>??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rabia</title>
		<link>http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/comment-page-2/#comment-1769</link>
		<dc:creator>rabia</dc:creator>
		<pubDate>Wed, 23 Nov 2011 13:22:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/#comment-1769</guid>
		<description>good :-)</description>
		<content:encoded><![CDATA[<p>good <img src='http://www.zparacha.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

