title: What regex should i use to validate a number pattern?
body: <p>For this first validate I try to validate an input of 4 digits, however when i try to run it and enter 4 digits the error still shows up: </p>
  
  <pre><code>function pCodeValidate() {
      var pCode = document.getElementById("postcode");
      var pCodePattern = /^\d{4}$/;
      if (!(pCodePattern.test(pCode))){
          errorList("post code must be 4 digits")
      } 
      //return
  }
  </code></pre>
  
  <p>The second one validates a mobile number with the pattern "04dddddddd, where d is a digit". this is my code: </p>
  
  <pre><code>function mNumberValidate() {
      var mNumber = document.getElementById("mobilenumber");
      var mNumberPattern = /^\d{10}$/;
      if (!(mNumberPattern.test(mNumber))){
          errorList("invalid mobile number");
      }
      //return
  }
  </code></pre>
  
  <p>For this second part what regex should I use to enforce "04" being the first value in the input?</p>