RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

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: The rating for this expression. John Pirkey
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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.


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials