title: javascript keypress function: case-insensitive a-z, numbers and a few special chars?
body: <pre><code>$('.s').keyup(function(e) {
  
      if (!/[A-Za-z0-9]/.test(String.fromCharCode(e.which))) {
          return false;
      }
  </code></pre>
  
  <p>I wonder what is the best regex solution for my application.
  I have an ajax-based search that should just trigger the search when actual characters are pressed like a-Z (upper and lowercase), numbers and maybe a questionmark, a dash(hyphen), and an exclamation mark. Also the spacebar should be enabled.</p>
  
  <p>Otherwise the ajax search would be triggered as well if the shift-, option, or control-key, is pressed.</p>
  
  <p>What's the easiest regex pattern to understand here?
  thank you for your help</p>