title: Regex not performing as expected
body: <p>I have this bit of code that i <em>think</em> should be detecting if the supplied string consists only of any number of spaces, followed by a comma, followed by any number of spaces:</p>
  
  <pre><code>if(str.match("/^[ ]*,[ ]*$/")) {
    //do something
  }
  </code></pre>
  
  <p>And the following string does not match " , ".   In fact, no number of spaces before or after a comma in a string that only consists of spaces and a single comma will match.  I think I may be confused with my syntax and it just hasn't clicked.</p>
  
  <p>I have also tried replacing the regex with these with no luck:</p>
  
  <pre><code>"/^[\s]*[,][\s]*$/"
  "/^[\s]*,[\s]*$/"
  "/^[ ]*[,][ ]*$/"
  </code></pre>
  
  <p>Any ideas?</p>