spazjr01
asked on
Search for 2 or more items in password validation using regular expression.
I am using Angular-JS and have the following expression, which checks a password input for 1 upper case letter, 1 lower case letter, 1 number, and one special character. However, I need it to check for 2 or more upper case letters, 2 or more lower case letters, 2 or more numbers, and 2 or more special characters. How do I modify the below expression to check for two or more instead of one or more?
ng-pattern="/^(?=^.{10,30} $)(?=.*\d) (?=.*[a-z] )(?=.*[A-Z ])(?=.*[!@ #$%^&* ()_+}{&quo t;:;'?/> ;.<,])( ?!.*\s).*$ $/"
ng-pattern="/^(?=^.{10,30}
This gets very difficult since the expression no longer remains regular (technically it becomes a context grammar). I would simply write it in Javascript.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.