I have this Regex-Javascript-Code to check a password between 8 to 50 characters which contain at least one lowercase letter, one uppercase letter, one numeric digit, and one special character.
var passwordformat = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,50}$/;
Now, I should have a Redex-Code is only true when at least 2 out of these 4 terms are valid.How can I expend my Regex-Code to achieve this?
I have never programmed a Regex Code. This code is copied out of the net.