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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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