Reputation: 274
I am trying to develop a regex pattern for password with following conditions 1) atleast 1 Uppercase character 2) atleast 3 lower case characters 3) atleast 1 digit 4) atleast 1 Special character 5) Minimum length should be 8 characters. This is my javascript function. Can somebody help me with the expression. Thanks
validatePassword : function(password){
if(this.isEmpty(password))
{
return false;
}
var regex = /^(?=.*[A-Z])(?=.*[!@#$&*])(?=.*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$/;
if(!regex.test(password))
{
return false
}
return true
}
Upvotes: 0
Views: 144