title: Regular expression for not allowing spaces in the input field
body: <p>I have a username field in my form. I want to not allow spaces anywhere in the string. I have used this regex:</p>
  
  <pre><code>var regexp = /^\S/;
  </code></pre>
  
  <p>This works for me if there are spaces between the characters. That is if username is <code>ABC DEF</code>. It doesn't work if a space is in the beginning, e.g. <code>&lt;space&gt;&lt;space&gt;ABC</code>.  What should the regex be?</p>