Hi
It's my first post, so hello everybody.
I have problem with regex expression. I have password validation by regex.This is my expression:
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$
It works - the password must contain at least 1 digit, at least 1 lower case letter, at least 1 upper case letter and at least special character: @#$%^&+=. So I have to input all this characters.
But I'd like password, which has at least 3 combination, not all 4.
So these passwords should be good:
2Df
(not special character), dF#
(not digit), a4%
(not upper case). I'd like to ask, how this regex expression should look? I could write each expression to check each combination, for example:
- Not include digit:
^(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$
- Not include upper case:
^(?=.*\d)(?=.*[a-z])(?=.*[@#$%^&+=]).*$
But maybe I can do it in one expression. Thanks for help.
Regards