showing results for - "react js require pasword to have special charaacter"
Matteo
17 Jan 2018
1var regularExpression = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$/;
2
Louane
07 Jun 2017
1function checkPassword(str)
2{
3    var re = /^(?=.*\d)(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,}$/;
4    return re.test(str);
5}
6
Clarabelle
10 Mar 2020
1analyze(event) {
2    if(strongRegex.test(event.target.value)) {
3        this.setState({ backgroundColor: "#0F9D58" });
4    } else if(mediumRegex.test(event.target.value)) {
5        this.setState({ backgroundColor: "#F4B400" });
6    } else {
7        this.setState({ backgroundColor: "#DB4437" });
8    }
9}
10
similar questions