title: How to check that there is only one "@" character in the string?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7443155/modify-regex-to-validate-email">Modify regex to validate email?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>$email = $_POST["email"];
  
  if(preg_match("[@{1}]",$email))
      echo "There is only one @ symbol";
  
  if(preg_match("[@{2,}]",$email))
      echo "There is more than one";
  </code></pre>
  
  <p>It's simple my problem but since I've rarely used regular expressions the output doesn't come out the way I want. Also $email is the post data.</p>
  
  <p>If $email has 2 or more @ symbols then it will display that there is more than one. If $email has 1 @symbol then it will display that there is only 1 @ symbol. Easy enough right?</p>