How to add password validation using regular expression in angularjs according to certain criterion?

后端 未结 4 1800
醉酒成梦
醉酒成梦 2021-02-20 16:33

I want to validate password entered by user for following criteria :

Password should be at least 8 characters long and should contain one number,one character an

4条回答
  •  无人及你
    2021-02-20 17:13

    As far as i understood your problem. Check your console It might be broken on lexical errors.

    You forgot slash at start and at end of ng-pattern. Please use ng-pattern="/^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$/"

    I have created a plunk which might help you. https://plnkr.co/edit/qCjp6a?p=preview

提交回复
热议问题