Regex for email confirmation
<p>I'm using the following code to make sure fields are filled in. How can I add some code to make sure it's a valid email?</p>

<pre><code>function verify() {
if ($("#ddlBusinessName").val() == "0") {
            alert("Please select the name.");
        }
        else if ($("#txtEmail").val().length &lt;= 0 || $("#txtEmailConfirm").val().length &lt;= 0) {
            alert("Please enter the email address and confirm the email address.");
             else if ($("#TxtPassword").val().length &lt;=0 || $("#TxtConfirmPassword").val().length &lt;=0) {
            alert("Please enter your password.");
        }

         }
</code></pre>

<p><strong>EDIT</strong>
How can I implement this into my code though?</p>

<pre><code> function validateEmail(email) { 
var re = /^(([^&lt;&gt;()[\]\\.,;:\s@\"]+(\.[^&lt;&gt;()[\]\\.,;:\s@\"]+)*)|(\
".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA
-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
} 
</code></pre>
