O React JS exige que a Pasword tenha Charaacter especial
var regularExpression = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$/;
Witty Weevil
var regularExpression = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$/;
function checkPassword(str)
{
var re = /^(?=.*\d)(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,}$/;
return re.test(str);
}
analyze(event) {
if(strongRegex.test(event.target.value)) {
this.setState({ backgroundColor: "#0F9D58" });
} else if(mediumRegex.test(event.target.value)) {
this.setState({ backgroundColor: "#F4B400" });
} else {
this.setState({ backgroundColor: "#DB4437" });
}
}