title: regex to match alphanumeric and hyphen only, strip everything else in javascript
body: <p>I want to strip everything except alphanumeric and hyphens.</p>
  
  <p>so far i've got this but its not working: </p>
  
  <pre><code>String = String.replace(/^[a-zA-Z0-9-_]+$/ig,'');
  </code></pre>
  
  <p>any help appreciated?</p>