title: JavaScript Regular Expression Email Validation
body: <p>This code is always alerting out <code>"null"</code>, which means that the string does not match the expression.</p>
  
  <pre class="lang-js prettyprint-override"><code>var pattern = "^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$"; 
  
  function isEmailAddress(str) {
  
      str = "azamsharp@gmail.com";      
  
      alert(str.match(pattern)); 
      return str.match(pattern);    
  
  }
  </code></pre>