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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?=^.{6,10}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+}{":;'?/>.<,])(?!.*\s).*$
Description
This regular expression match can be used for validating strong password. It expects atleast 1 small-case letter, 1 Capital letter, 1 digit, 1 special character and the length should be between 6-10 characters. The sequence of the characters is not important. This expression follows the above 4 norms specified by microsoft for a strong password.
Matches
1A2a$5 | 1234567Tt# | Tsd677%
Non-Matches
Tt122 | 1tdfy34564646T*
Author Rating: The rating for this expression. Sujata Bhave
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: Mr
Name: Jim
Date: 8/16/2019 12:47:17 PM
Comment:
Fuck


Title: Jsjdjsj
Name: jdjsjdj
Date: 5/2/2019 11:19:40 AM
Comment:
Password must be between 8 - 16 character long and include at least one number and capital letter


Title: Works in C# - Good job!
Name: aspdotnetwebdev
Date: 8/22/2018 3:15:30 PM
Comment:
I really appreciate your work posting and/or creating this regex


Title: No one
Name: No Name
Date: 10/25/2016 9:04:00 AM
Comment:
No comment


Title: This site is a Great Resource !!
Name: Nap
Date: 11/26/2013 6:54:12 AM
Comment:
The expression given by Sujata works fine, and correctly rejects StarGate22 WHEN YOU substitute: & with the actual symbol '&' (ie shift-7). AND DO THE SAME for all the other html encodings; " = double quote > = Greater Than symbol < = Less Than symbol. Enjoy, Nap


Title: This site is a Great Resource !!
Name: Nap
Date: 11/26/2013 6:41:47 AM
Comment:
The expression given by Sujata works fine, and correctly rejects StarGate22 WHEN YOU substitute: & with the actual symbol '&' (ie shift-7). AND DO THE SAME for all the other html encodings; " = double quote > = Greater Than symbol < = Less Than symbol. Enjoy, Nap


Title: Thanx Zaheer
Name: PeK
Date: 9/9/2013 3:43:35 AM
Comment:
perfect - saved me a lot of time


Title: Matched even no special character
Name: Zaheer
Date: 6/18/2013 8:15:37 AM
Comment:
i have given StarGate22 it still matching this i didnt enter any special character here and i have found solution ((?=.*\d)(?=.*[A-Za-z])(?=.*\W).{8,25})


Title: not enforcing?
Name: John
Date: 4/12/2010 10:52:29 AM
Comment:
This should not be a match: p2ssword but when i test it on this site, it matches. it doesn't even have a special character.


Title: Slight error
Name: John
Date: 9/25/2009 8:27:03 AM
Comment:
This doesn't force all 4 rules. tt122& is ok. As long as you have a number and a special character, you could enter all upper case or all lower case letters and it would still be valid. Any way to force to have 1 upper and 1 lower as well as 1 digit and 1 special?


Title: Thanking you
Name: Rajan
Date: 1/21/2008 11:49:10 AM
Comment:
Really superb, ur regular expression is very good Thanks alot,


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