Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I need Regular expression for validating a password .
Format :- Minimum 8 characters and Maximum 50 , at least 1 Alphabet, 1 Number and 1 Special Character,Spaces Not Allowed
Posted
Comments

 
Share this answer
 
Hi there...

Regular Expression for your requirements is :

/(?=^.{8,50}$)(?=(?:.*?\d))(?=.*[a-z])(?=(?:.*?[@#$%}{:;?.]){1})(?!.*\s)/



(?=(?:.*?[@#$%}{:;?.]){1}) : It looks for at least one Special characters like @,#,$,%. You can place other special characters also.


Thanks.
 
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