title: Compare length of string in regex javascript
body: <p>I don't have much knowledge about working of regex but I have been trying to solve this from last many hours but could not get solution of it`.</p>
  
  <pre><code>regex  /^[]{13,17}$/i
  </code></pre>
  
  <p>I have a text-box and text-box value should be greater than or equal to 13 and less than or equal to 17.</p>
  
  <blockquote>
    <p>Ex. </p>
  </blockquote>
  
  <pre class="lang-js prettyprint-override"><code>var value - "12345678901234".(textbox value and length is 14)
  if (value.match(regex)) {
    alert("Correct value");
  } else {
    alert("error");
  }
  </code></pre>
  
  
  
  <p>Now, length is 14, it means condition should be true. But match function always return <code>null</code>. I have tried also test function, but it doesn't give desired result.</p>