title: Regular Expression max-length is not working
body: <pre><code>function test() {
      var regex = new RegExp("^[0-9]{1,11}$");
      var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
      if (!regex.test(key)) {
          event.preventDefault();
          return false;
      }
  }
  </code></pre>
  
  <p>It is correct to take only integer but max-length is not working. It takes more than 11 digits.</p>