title: Regex to validate length of alphanumeric string
body: <p>I have the following regular expression:</p>
  
  <pre><code>^[a-zA-Z0-9]+( [a-zA-Z0-9]+)*$
  </code></pre>
  
  <p>I'm trying to validate a string between 0-10 characters, the string cannot contain more the two spaces in a row or cannot be empty. The string cannot contain any special characters and can be case insensitive and can include hyphens.</p>
  
  <p>How can I limit input to between 0-10 characters?</p>
  
  <p>I tried </p>
  
  <pre><code>^[a-zA-Z0-9]+( [a-zA-Z0-9]+{0,10})*$
  </code></pre>
  
  <p>but it does not work.</p>