Click here to Skip to main content
15,747,637 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
anyone plz tell me how to validate the password field with below conditions

password must contain atleast 6 characters and atleast one Capital letter and atleast one small letter and atleast one number.

thanks
Posted

Seems a pretty straight forward thing for you to write. If I were you, I'd start by validating the length - keep going with the validation though, as you should report all the problems to the user. Then you can use three simple regular expressions to see if you have any matches (one for each of the other conditions).
 
Share this answer
 
D Anil Kumar wrote:
password must contain atleast 6 characters
Use length[^] property
D Anil Kumar wrote:
and atleast one Capital letter and atleast one small letter and atleast one number
Use Regular expressions[^]
 
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