Posts Tagged ‘strong password’

If you want to create an application which accepts only strong password, then here is a solution for you. You can apply the following regular expression which creates a validation for you to allow only strong password.

(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$

Description of this regular expression is as below:

Passwords will contain at least 1 upper case letter
Passwords will contain at least 1 lower case letter
Passwords will contain at least 1 number or special character
Passwords will contain at least 8 characters in length
Password maximum length should not be arbitrarily limited

let me know if you want any change in current regular expression according to your requirements.

Happy¬†coding…

Advertisements