title: Preg_match using array?
body: <p>Correct usage is: <code>/,,([,]+)?|^,|,$|\b,\b|\s,/</code></p>
  
  <pre><code>$comma[0] = '/,,([,]+)?/';  
              $comma[1] = '/^,/';     
              $comma[2] = '/,$/';
              $comma[3] = '/\b,\b/';  
              $comma[4] = '/\s,/';    
  
  $analyst = preg_match($comma, $_POST['analyst']) 
      ? mysql_real_escape_string($_POST['analyst']) : NULL;
  </code></pre>
  
  <p>I am trying to detect commas from the users input, each regex is defined properly, but I do not understand why it isn't passing them into the if statement.</p>
  
  <p>Edit: </p>
  
  <p>if I change this:</p>
  
  <pre><code>$analyst = preg_match('test', $_POST['analyst']) 
      ? mysql_real_escape_string($_POST['analyst']) : NULL;
  </code></pre>
  
  <p>then it works, this makes no sense.</p>