title: val.replace(/[^a-zA-Z_-0-9]/g, '') produce SyntaxError: invalid range in character class
body: <p>I need to replace all chars which are not match with range <code>a-zA-Z_-0-9</code>. So I do <code>val.replace(/[^a-zA-Z_-0-9]/g, '')</code> but get error. How can I bit this?
  Thanks</p>