title: Javascript Regular Expressions Email Address
body: <p>So I have a homework assignment that I have completed. But I can not get the email address to test correctly. From what I can tell everything is correct.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Lab 5, Part 3&lt;/title&gt;
  &lt;script&gt;
  function validate()
  {
  var email = document.forms["form1"]["email"].value;
  var emailValidator = "/^\w+([\.-]?\w+)+@\w+([\.:]?\w+)+(\.[a-zA-Z0-9]{2,3})+$/";
  
  if (!email.match(emailValidator))
  {
   alert("Not a valid Email Address");
   return false;
  }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1 style="text-align:center"&gt;Lab 5, Part 3 for &lt;/h1&gt;
  &lt;h2 style="text-align:center"&gt;IT 3203&lt;/h2&gt;
  
  &lt;form name="form1" action="http://weblab.kennesaw.edu/formtest.php" onsubmit="return validate();" method="get"&gt;
  &lt;p&gt; Email: &lt;input type="text" id="email" name="email"&gt;&lt;/p&gt;
       &lt;input type="Submit" value="Submit"&gt;
  &lt;/form&gt;
  
  &lt;p&gt;&lt;a href=index.html&gt;Back to Main Page&lt;/a&gt;&lt;/p&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>