regex password matcher js code example
Example 1: js regex password
str.match(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/)
Example 2: javascript password validation special character
function CheckPassword(inputtxt)
{
var paswd= /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{7,15}$/;
if(inputtxt.value.match(paswd))
{
alert('Correct, try another...')
return true;
}
else
{
alert('Wrong...!')
return false;
}
}