Title |
Test
Find
Strong Password Validation
|
Expression |
^(?=.*[!@#$%^&*()\-_=+`~\[\]{}?|])(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).{8,20}$ |
Description |
This should require all of the following: An uppercase letter, a lowercase letter, a number and a special character from the provided list. Lastly, it needs to be between 8 and 20 characters long.
A lot of expressions I've found here don't require all four, this should. I'm pretty new at regex though, so I hope that other people will help strengthen this expression.
When testing on this site, make sure you have the Case Insensitive checkbox turned off. |
Matches |
p2sSw@rd | p2sSw@rd#l0ngEr | abc#$%GH1 |
Non-Matches |
p2ssw@rd | p2sSw@rd#l0ngErThisIs2l0ng | abc123DEF |
Author |
Rating:
John Pirkey
|
Source |
|
Your Rating |
|
Title: IE7 v IE8
Name: John
Date: 4/21/2010 9:50:12 AM
Comment:
I just found out this expression doesn't validate when used in a asp.net regular expression validator control while viewing the page in an IE7 browser. It works in IE8 and FF3 though.