Click here to Skip to main content
15,887,302 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I need PasswordStrengthRegularExpression to allow password greater than 8 char with 1 numeric, 1 special character, 1 alphabet but exclude "&" in Special character
Posted
Updated 10-Feb-13 23:08pm
v2
Comments
Orcun Iyigun 11-Feb-13 5:04am    
Why don't you use AJAX Tool Kit's Password Strength[^]?
Srimathi89 11-Feb-13 5:11am    
I dont wanna use Ajax control toolkit in my application. Please provide me PasswordStrengthRegularExpression to be added in web.config
phil.o 11-Feb-13 5:14am    
Regular Expressions are not the best solution to enforce some password constraints.
But, if you want to persist this way, I recommend you to use Expresso to build your regular expressions.

Take a look on this discussion http://forums.asp.net/t/918584.aspx/1

Based on it you can build your regex. Something like this:
^(?=[^&]*\d)(?=[^&]*[a-zA-Z])(?=[^&]*[%$#^*@\-:]).{8,}$

[%$#^*@\-:] in this square brackets allowed special characters are defined.

If you want to learn more about regex I advice to look here The 30 Minute Regex Tutorial[^]
 
Share this answer
 
Hi,

This regular expression works fine for me:
((?=.*[a-zA-Z]+)(?=.*[0-9]+)(?=.*[^a-zA-Z0-9&]+))(?:.{8,})

Hope this helps.
 
Share this answer
 

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