title: Regex to allow only numbers and max 2 digits
body: <p>I am working on an input field, that should allow users to enter numbers from 0 to 99. In addition the user should not be allowed to type in a 3rd digit.</p>
  <p>To tackle the above i have the following regex
  <code>/^([0-9]{2})$/</code></p>
  <p>I have the following function that is triggered on keypress event</p>
  <pre><code>    onlyAllowNumbers(evnt: KeyboardEvent): boolean {
          const charCode = evnt.key;
          const pattern = /^([0-9]{2})$/;
  
          return pattern.test(charCode);
  }
  </code></pre>
  <p>The above pattern isn't allowing me to enter in any numbers in the input field.</p>