Validate Strong Password

Posted by admin on July 25, 2008

If you ever had to code a user authentication system, you probably know how much fun it can be to write your own strong password validation. Luckily, Charles Forsyth has developed a regular expression (and published it at Regular Expression Library) that will validate a strong password.

Regular Expression Library

The regular expression works for passwords that:

  • are at least 15 characters long
  • contain at least one (1) numerical digit
  • contain at least one lowercase character
  • contain at least one special character (such as !, @, #, %, etc.)

Strong passwords to be validated may not contain any whitespace, and they cannot contain the strings pass, word or password.

Leave a Reply