title: How to limit a string length
body: <p>I have the following regex:</p>
  
  <pre><code>^[a-zA-Z_][\-_a-zA-Z0-9]*
  </code></pre>
  
  <p>I need to limit it's length to 39 characters. I tried the following but it didn't work:</p>
  
  <pre><code>^[a-zA-Z_][\-_a-zA-Z0-9]*{,38}
  </code></pre>