title: Regex to allow word characters, parentheses, spaces and hyphen
body: <p>I'm trying to validate a string with regex in javascript. The string can have:</p>
  
  <ul>
  <li>word characters</li>
  <li>parentheses</li>
  <li>spaces</li>
  <li>hyphens (-)</li>
  <li>3 to 50 length</li>
  </ul>
  
  <p>Here's my attempt: </p>
  
  <pre><code>function validate(value, regex) {
      return value.toString().match(regex);
  }
  
  validate(someString, '^[\w\s/-/(/)]{3,50}$');
  </code></pre>