title: how to use regex.test class in javascript
body: <p>i am doing client side validation in Zend framework2 and using regex. test class for this purpose but not getting the correct result 
  i m using in the following way</p>
  
  <pre><code>var regex = new RegExp('/^[a-zA-Z0-9_-\s]{1,50}+$/');
  console.log(regex.test(id_val));
  </code></pre>
  
  <p>but it always returns false.
  does any one knows how to use it?</p>