title: jQuery Validate plugin - password check - minimum requirements - Regex
body: <p>I've got a little problem with my password-checker.</p>
  
  <p>There's got a registration form with some fields.
  I use jQuery Validate plugin to validate user-inputs.</p>
  
  <p>It all works except the password-validation:</p>
  
  <p>The password should meet some minimum requirements:</p>
  
  <ul>
  <li>minimum length: 8 -> I just use 'minlength: 8'</li>
  <li>at least one lower-case character</li>
  <li>at least one digit</li>
  <li>Allowed Characters: A-Z a-z 0-9 @ * _ - . !</li>
  </ul>
  
  <p>At the moment I use this code to validate the password:</p>
  
  <pre><code>$.validator.addMethod("pwcheck",
  function(value, element) {
     return /^[A-Za-z0-9\d=!\-@._*]+$/.test(value);
  });
  </code></pre>
  
  <p>This Code works for the allowed characters but not for minimum requirements.
  I know that you can use for example <code>(?=.*[a-z])</code> for a lower-case-requirement. But I just don't get it to work.</p>
  
  <p>If I add <code>(?=.*[a-z])</code> the whole code doesn't work anymore. I need to know how to properly add the code to the existing one.</p>
  
  <p>Thank you for your answers!</p>
  
  <p>This is the complete code</p>
  
  <pre><code>&lt;script&gt;
                  $(function() {
                      $("#regform").validate({
                          rules: {
                              forename: {
                                  required: true
                              },
                              surname: {
                                  required: true
                              },
                              username: {
                                  required: true
                              },
                              password: {
                                  required: true,
                                  pwcheck: true,
                                  minlength: 8
                              },
                              password2: {
                                  required: true,
                                  equalTo: "#password"
                              },
                              mail1: {
                                  required: true,
                                  email: true
                              },
                              mail2: {
                                  required: true,
                                  equalTo: "#mail1"
                              }
                          },
                          messages: {
                              forename: {
                                  required: "Vornamen angeben"
                              },
                              surname: {
                                  required: "Nachnamen angeben"
                              },
                              username: {
                                  required: "Usernamen angeben"
                              },
                              password: {
                                  required: "Passwort angeben",
                                  pwcheck: "Das Passwort entspricht nicht den Kriterien!",
                                  minlength: "Das Passwort entspricht nicht den Kriterien!"
                              },
                              password2: {
                                  required: "Passwort wiederholen",
                                  equalTo: "Die Passwörter stimmen nicht überein"
                              },
                              mail1: {
                                  required: "Mail-Adresse angeben",
                                  email: "ungültiges Mail-Format"
                              },
                              mail2: {
                                  required: "Mail-Adresse wiederholen",
                                  equalTo: "Die Mail-Adressen stimmen nicht überein"
                              }
                          }
                      });
  
                      $.validator.addMethod("pwcheck",
                          function(value, element) {
                              return /^[A-Za-z0-9\d=!\-@._*]+$/.test(value);
                      });
                  });
                  &lt;/script&gt;
  </code></pre>