title: Password validation (regex?)
body: <p>I need to write some validation rules for a user password with the following requirements. C# ASP.NET MVC.</p>
  
  <blockquote>
    <p>Passwords must be 6 - 8 characters<br />
    Must include at least one character
    each from at least three of the
    following categories:<br /></p>
  </blockquote>
  
  <ol>
  <li>Upper-case letters</li>
  <li>Lower-case letters</li>
  <li>Numeric digits</li>
  <li>Non-alpha-numeric characters (e.g.,!@#$%...)</li>
  </ol>
  
  <blockquote>
    <p>Must not contain any
    sequence of 3 or more characters in
    common with the username <br />Must not
    repeat any of the previous 1 passwords<br />
    Must be changed if the password is
    believed to be compromised in any way</p>
  </blockquote>
  
  <p>Currently i've written a bunch of really messy validation rules using if statements and loops (especially the 3 characters in sequence with username part), which is currently functional but it just feels like its wrong. Is there a better approach I can take? </p>
  
  <p>Thankyou</p>