title: Problem with match function in javascript for numeric validation
body: <p>I have written following function to restrict only numbers with the limit of 2 numbers (below 100). </p>
  
  <p>The first part checks special charters and letters.  I got stuck in <code>else</code> part.</p>
  
  <p>And Now I am trying to restrict with only 2 digits numeric number (without decimal). But it doesn't work the logic in below code. I am not allowed to use <code>input type =number</code> in <code>HTML</code>. The html input type is text</p>
  
  <pre><code> $(".allownumericTwo").on("input", function (evt) {
       var charCode = (evt.which) ? evt.which : event.keyCode
       if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57) &amp;&amp; charCode != 46)
           return false;
       else {
           $(this).val($(this).val().match(\d{0,2});
       }
       return true;
  });
  </code></pre>