title: Regular expression for field validation in c#
body: <p>I'm not good at regular expressions. I need to do the validate if a password is correct or not.</p>
  
  <p>Conditions:</p>
  
  <p>Your password can be 8-32 characters long and <strong>it must include
  at least two</strong> of the following characters:</p>
  
  <ol>
  <li>At least one letter (uppercase or lowercase)</li>
  <li>At least one number </li>
  <li>At least one special character</li>
  </ol>
  
  <p>The Regex from <em><a href="https://stackoverflow.com/q/10557441/3744182">regex to allow atleast one special character, one uppercase, one lowercase(in any order)</a></em> requires all three of each and has no upper limit on length, so it appears I need to modify the <a href="https://stackoverflow.com/a/10557545/3744182">solution</a> by <a href="https://stackoverflow.com/users/20670/tim-pietzcker">Tim Pietzcker</a>, which is </p>
  
  <blockquote>
    <p><code>^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&amp;+=]).*$</code></p>
    
    <p>will match any string of at least 8 characters that contains at least one lowercase and one uppercase ASCII character and also at least one character from the set <code>@#$%^&amp;+=</code> (in any order). </p>
  </blockquote>