I want to write a regular expression for a password with these conditions:
1- The password must contains 4 letters at least.
2- The password must contains 2 digits.
3- The password must contains 2 punctuation symbols.
4- The password must have a minimum length of 8 characters.
This is the regular expresion that I have: "^((?=.*?\\p{L}.{4,})(?=.*?\\p{N}.{2,})(?=.*?\\p{P}.{2,})).{8,}$"
And my problem is that yhis expresion doesn't accept this as password an I don't know why: "abcd12.-".
Can anyone help me with this problem? Thank you