title: Invalid regular expression in javascript
body: <p>I'm trying to find out if a string contains css code with this expression:</p>
  
  <pre><code>var pattern = new RegExp('\s(?[a-zA-Z-]+)\s[:]{1}\s*(?[a-zA-Z0-9\s.#]+)[;]{1}');
  </code></pre>
  
  <p>But I get "invalid regular expression" error on the line above...</p>
  
  <p>What's wrong with it?</p>
  
  <p>found the regex here: <a href="http://www.catswhocode.com/blog/10-regular-expressions-for-efficient-web-development" rel="nofollow">http://www.catswhocode.com/blog/10-regular-expressions-for-efficient-web-development</a></p>
  
  <p>It's for PHP but it should work in javascript too, right?</p>