title: Regex to match at least 2 digits, 2 letters in any order in a string
body: <p>I'm trying to create a regex to pattern match (for passwords) where the string must be between 8 and 30 characters, must have at least 2 digits, at least 2 letters (case-insensitive),at least 1 special character, and no spaces.</p>
  
  <p>I've got the spaces and special character matching working, but am getting thrown on the 2 digits and 2 letters because they don't need to be consecutive.</p>
  
  <p>i.e.  it should match <code>a1b2c$</code>  or <code>ab12$</code> or <code>1aab2c$</code>.   </p>
  
  <p>Something like this for the letters?  </p>
  
  <pre><code>(?=.*[a-zA-Z].*[a-zA-Z])  // Not sure.
  </code></pre>
  
  <p>This string below works, but only if the 2 letters are consecutive and the 2 numbers are consecutive..it fails if the letters, numbers, special chars are interwoven.</p>
  
  <pre><code>(?=^.{8,30}$)((?=.*\\d)(?=.*[A-Za-z]{2})(?=.*[0-9]{2})(?=.*[!@#$%^&amp;*?]{1})(?!.*[\\s]))^.* 
  </code></pre>