RegEx strong password pattern

Coordinator
Oct 2, 2008 at 10:44 PM
Edited Oct 2, 2008 at 10:46 PM

(?=[!@#'^=:;*-.a-zA-Z0-9]*?[A-Z])(?=[!@#'^=:;*-.a-zA-Z0-9]*?[!@#'^=:;*-.])(?=[!@#'^=:;*-.a-zA-Z0-9]*?[a-z])(?=[!@#'^=:;*-.a-zA-Z0-9]*?[0-9])[!@#-'^=:;*-.a-zA-Z0-9]{8,}

Be sure to put quotes around it when using it on the command-line. In theory, this pattern implements the following conditions:

1. A contiguous word (passwords typically don’t allow whitespace)
2. Contains at least one number, 1-9
3. Contains at least one lowercase letter, a-z
4. Contains at least one uppercase letter, A-Z
5. Contains at least one character other than the three classes above
6. Is at least eight characters long