Click here to Skip to main content
15,919,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Registration form password Field Enter Character,One Numeric ,one Symbols,and one Uppercase Character in asp.net
how to solve this using any jquery ,javascript or any password validation
Posted

( # Start of group
(?=.*\d) # must contains one digit from 0-9
(?=.*[a-z]) # must contains one lowercase characters
(?=.*[A-Z]) # must contains one uppercase characters
(?=.*[@#$%]) # must contains one special symbols in the list "@#$%"
. # match anything with previous condition checking
{6,20} # length at least 6 characters and maximum of 20
) # End of group

RegExp : ((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})

See this :
http://www.mkyong.com/regular-expressions/how-to-validate-password-with-regular-expression/[^]

-KR
 
Share this answer
 
Comments
Ashvinrajkot 8-Mar-14 0:13am    
you can send me java code link.but i can not use in asp.net
Ashvinrajkot 8-Mar-14 0:15am    
also this regexp check validation but i can enter must this requirement
Hi,
You are basically asking about strong password field for the user.So here is the solution you can use regular expression validation and you can pass this expression as per your requirement.

^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$


ASP.NET
<pre><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
            ErrorMessage="Please enter a strong passord with min of 10 charecter" ControlToValidate="TextBox1" 
            ValidationExpression="^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&amp;+=]).*$"></asp:RegularExpressionValidator>
            
        <asp:Button ID="Button1" runat="server" Text="Button" />
 
Share this answer
 
v2

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