Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
A complex password has the following requirements:
Contain at least three of the five following character types:
o Lower case characters
o Upper case characters
o Numbers
o Punctuation
o “Special” characters (e.g. @#$%^&*()_+|~-=\`{}[]:";'<>/ etc)
Contain at least eight (8) alphanumeric characters.
Posted
Updated 16-Apr-15 2:39am
v2
Comments
ramyajaya 16-Apr-15 11:24am    
Try this

^(?=(.*\d))(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z\d])(?=(.*\W)).{8,}$
Nityananda Das 17-Apr-15 0:38am    
i already tried this but it includes punctuations also.I need special characters and punctuations both separate also its contains Contain at least three of the five following character types:
o Lower case characters
o Upper case characters
o Numbers
o Punctuation
o “Special” characters (e.g. @#$%^&*()_+|~-=\`{}[]:";'<>/ etc)

1 solution

Please have a look here:
http://www.aspsnippets.com/Articles/Implement-Password-Policy-using-Regular-Expressions-and-ASPNet-RegularExpression-Validator.aspx[^]
You can reuse the given regular expressions in your source code.
 
Share this answer
 
Comments
Nityananda Das 17-Apr-15 0:38am    
I need special characters and punctuations both separate also it contain at least three of the five following character types:
o Lower case characters
o Upper case characters
o Numbers
o Punctuation
o “Special” characters (e.g. @#$%^&*()_+|~-=\`{}[]:";'<>/ etc)
TheRealSteveJudge 17-Apr-15 2:44am    
We cannot do the homework for you.

Please have a look at the posted link and try to adapt any of the examples
to your needs.

When you get problems you're welcome to reply.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900