title: Password max length
body: <p>I have a password validation script for the signup process and it works OK if I don't set a maximum length limit. If I add a maximum limit of 32 it ignores the validation, creating the account, even if I have more than 32 characters. </p>
  
  <p>Working script:</p>
  
  <pre><code>    if (preg_match("/^.*(?=.{8,})(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*$/", $_POST["password"]) === 0)
      {
          echo "The password must contain lower case characters, upper case characters and numbers. It's length should be between 8 and 32 characters.";
      }
  </code></pre>
  
  <p>Not working script:</p>
  
  <pre><code>if (preg_match("/^.*(?=.{8,32})(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*$/", $_POST["password"]) === 0)
          {
              echo "The password must contain lower case characters, upper case characters and numbers. It's length should be between 8 and 32 characters.";
          }
  </code></pre>
  
  <p>Please let me know before downrating so that I can edit my question. Thanks!</p>