title: Javascript password validation at least 2 number digits
body: <p>I am trying to write a javascript validation for a password with the following criteria:</p>
  
  <p>Password Must: </p>
  
  <ul>
  <li>Have exactly 8 characters</li>
  <li>Contain letters and numbers</li>
  <li>Contain at least two numbers</li>
  </ul>
  
  <p>EG:
   "helloo15", "1helloo5" and "h1111111" are valid, "helloo1500", "27272727"and "helloos5" are invalid.</p>
  
  <p>This is what I currently have:</p>
  
  <pre><code>//Password
      var pw = document.myForm.password1.value;
      var Vpw = /^[a-zA-Z0-9]{8}$/;
      if (!Vpw.test(pw)) {
          alert("Password must be 8 digits long. It must include a maximum of two numbers.");
          return false;           
      } else {
  /*      alert("Valid CCV!");     */     
      }
  </code></pre>
  
  <p>But I can't figure out how to limit it to a minimum of 2 numbers anywhere in the string. Thanks!    </p>