title: Adding minimum Characters to Password
body: <p>I have a working code to verify two passwords, but I need to add a minimum amount of characters</p>
  
  <p>This is a smaller chunk of a larger project, but for the html I have:</p>
  
  <pre><code>&lt;input id="username" type="text" name="username" placeholder="username" size="30"&gt;
  &lt;label for="pass1"&gt;Password:&lt;/label&gt;
  &lt;input type="password" placeholder="password" name="pass1" id="pass1"&gt;
  &lt;label for="pass2"&gt;Confirm Password:&lt;/label&gt;
  &lt;input type="password" name="pass2" id="pass2" placeholder="password" onkeyup="checkPass(); return false;"&gt;
  &lt;span id="confirmMessage" class="confirmMessage"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>As for my code I have</p>
  
  <pre><code>function checkPass()
  {
      var pass1 = document.getElementById('pass1');
      var pass2 = document.getElementById('pass2');
      var message = document.getElementById('confirmMessage');
      var goodColor = "#66cc66";
      var badColor = "#ff6666";
      if(pass1.value == pass2.value)
      {
          pass2.style.backgroundColor = goodColor;
          message.style.color = goodColor;
          message.innerHTML = "Passwords Match!"
      }
      else
      {
          pass2.style.backgroundColor = badColor;
          message.style.color = badColor;
          message.innerHTML = "Passwords Do Not Match!"
      }
  }  
  </code></pre>
  
  <p>How do I correctly add the expression <code>(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/)</code> to my code for it to correctly execute?</p>