title: Help with password complexity regex
body: <p>I'm using the following regex to validate password complexity:</p>
  
  <pre><code>/^.*(?=.{6,12})(?=.*[0-9]{2})(?=.*[A-Z]{2})(?=.*[a-z]{2}).*$/
  </code></pre>
  
  <p>In a nutshell: 2 lowercase, 2 uppercase, 2 numbers, min length is 6 and max length is 12.</p>
  
  <p>It works perfectly, except for the maximum length, when I'm using a minimum length as well.</p>
  
  <p>For example:</p>
  
  <p><code>/^.*(?=.{6,})(?=.*[0-9]{2})(?=.*[A-Z]{2})(?=.*[a-z]{2}).*$/</code></p>
  
  <p>This correctly requires a minimum length of 6!</p>
  
  <p>And this:</p>
  
  <pre><code>/^.*(?=.{,12})(?=.*[0-9]{2})(?=.*[A-Z]{2})(?=.*[a-z]{2}).*$/
  </code></pre>
  
  <p>Correctly requires a maximum length of 12.</p>
  
  <p>However, when I pair them together as in the first example, it just doesn't work!!</p>
  
  <p>What gives?  Thanks!</p>