title: Regular Expression for strong password in MVC model
body: <p>I need to create a regular expression to validate a strong password in my MVC Model.  Here are the rules that I need to apply:</p>
  
  <ul>
  <li>Min 7 characters</li>
  <li>Max 15 characters</li>
  <li>At least 3 out of 4 different types of characters. 
  
  <ul>
  <li>Numbers</li>
  <li>Lowercase</li>
  <li>Uppercase</li>
  <li>Special (viz. <code>!@#$%&amp;/=?_.</code>)</li>
  </ul></li>
  </ul>
  
  <p>Here's what I have tried so far:</p>
  
  <pre><code>[DataType(DataType.Password)]
  [RegularExpression("([a-z]|[A-Z]|[0-9]|[\\W]){4}[a-zA-Z0-9\\W]{3,11}", ErrorMessage = "Invalid password format")]        
  public string Password { get; set; }
  </code></pre>