title: Regex to check if string contains Alphanumeric Characters and Spaces only - javascript
body: <p>This is what I have so far:</p>
  
  <pre><code>function checkTitle(){
      reg = /^[\w ]+$/;
      a = reg.test($("#title").val());    
      console.log(a);
  }
  </code></pre>
  
  <p>So far in my tests it catches all special characters except <code>_</code>.
  How do I catch all special characters including <code>_</code> in the current function?</p>
  
  <p>I need the string to only have Alphanumeric Characters and Spaces. Appreciate the help cause I am having a hard time understanding <strong>regex</strong> patterns.</p>
  
  <p>Thanks!</p>