title: Regular expression for email not working
body: <p>I am putting validation on email field but it shows error of invalid even where the email is typed in correct format.</p>
  
  <p><a href="http://i.stack.imgur.com/su9nZ.jpg" rel="nofollow">Screenshot</a></p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function formvalidate(){
      var email=document.signup_form.email.value;
  
      var check_email= RegExp("^[A-Z0-9._-]+@[A-Z0-9.-]+\.[A-Z0-9.-]+$");
  
      if(email=="")
      {
          alert("cannot be empty!");
          document.signup_form.email.focus();
          return false;
      }
  
      else if(!check_email.test(email))
      {
          alert("enter valid email address!");
          document.signup_form.email.focus();
          return false;
      }
      else
      {
          return true;
      }
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Thanks</p>