title: ngPattern for validatin a String
body: <p>We have a requirement for a string field validation as below:</p>
  <ul>
  <li>It can contain alpha numeric characters and spaces are allowed too.
  But entire string can not be empty spaces alone.</li>
  <li>Lenth is minimun 1 character and maximum legth is 7.</li>
  <li>Case insensitive.</li>
  </ul>
  <p>I tried the following Regex but it did not work.</p>
  <pre><code>/^(?!\s+$)[a-z\d\-_\s]{1,7}+$/i
  </code></pre>
  <p>Example Strings that should match: &quot;QWE RTY&quot;, &quot;qwe&quot;, &quot;13 Z x&quot;, &quot;sh qwe1&quot;
  Example Strings that shoud not match:</p>
  <ul>
  <li>&quot;qw##@&quot;(includes special characters)</li>
  <li>&quot;        &quot;(spaces)</li>
  <li>&quot;qwerty123&quot;(more than 7 characters)</li>
  </ul>