title: REgular expression - allow dashes?
body: <p>I have the following javascript that does not allow the user to input any special characters into a field, but I do want to make an exception and allow for a dash (-):</p>
  
  <pre><code>function Validate(txt)
  {
      txt.value = txt.value.replace(/[^a-zA-Z 0-9\n\r]+/g, '');
  }
  </code></pre>
  
  <p>How to modify it to add the dash to the allowed list?</p>