title: ng-pattern to allow spaces between words
body: <p>I am looking for a <code>regular expression</code> that prevents <strong>special characters and only allows letters, numbers, dash (-), underscore (_) an space</strong>. </p>
  
  <p>This regex works great but it doesn't allow for spaces between words.</p>
  
  <p>For example, if enter <code>"123  456"</code>, i get custom error i defined. 
  How i can tweak this reg to allow space between words as well in addition to letters, numbers, dash and underscore.</p>
  
  <pre><code>&lt;input type="text" name="serialNumber" data-ng-model="SerialNumber" ng-pattern="/^[a-zA-Z0-9_-]*$/" maxlength="100"/&gt;
  &lt;div data-ng-if="Form.serialNumber.$error.pattern" class="error"&gt;Please enter valid serial number&lt;/div&gt;
  </code></pre>