title: Having a problem validating email address in PHP with preg_match
body: <p>Here's the code:</p>
  
  <pre><code>if(trim($_POST['email']) == '')  {
          $hasError = true;
      } else if (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
          $hasError = true;
      } else {
          $email = trim($_POST['email']);
      }
  </code></pre>
  
  <p>Here's the error msg:</p>
  
  <p>Warning: preg_match() [function.preg-match]: No ending delimiter '/' found in /home/bigsilkd/public_html/UBA/join.php on line 22</p>