title: Javascript - Regular Expression to match a number long 5 digits
body: <p>I have a JS file that is already connected to my HTML template. And I have an input form which I want it only accept Numbers 0-9, with an exact number of characters of 5 numbers. 
  So I placed the function:</p>
  
  <pre><code>function validate (input) {
    if($(input).attr('type') == 'text' || $(input).attr('name') == 'text') {
    if($(input).val().trim().match(/^[0-9].{5}/) == null) {
      return false;
    }
   }
  </code></pre>
  
  <p>Now the input cannot proceed with entered number, tried letters, numbers, less than 11 character and more than 5 but it still returns an error.</p>
  
  <p>When I use this one, it accepts numbers only, doesn't accept less than 5 characters, but it can accept more than 5 which I don't want.</p>
  
  <pre><code>function validate (input) {
    if($(input).attr('type') == 'text' || $(input).attr('name') == 'text') {
    if($(input).val().trim().match(/^[0-9]{5}/) == null) {
      return false;
    }
   }
  </code></pre>
  
  <p>Please help me editing this match <code>match(/^[0-9]{5}/)</code> to make it:</p>
  
  <ul>
  <li>Accept only numbers</li>
  <li>Accept only and exact number of characters (5 characters only)</li>
  </ul>