I have created regex for password validation in a Java app. The regex I created is below for below requirement.
^[\\p{Alnum}#.!@$*&_]{5,12}$
- At least 5 chars and max 12 chars
- Contains at least one digit
- Contains at least one char
- may contain chars within a set of special chars (#.!@$*&_)
- Does not contain space, tab, etc.
I am missing 1 and 2 like if I give "gjsajhgjhagfj" or "29837846876", it should fail. But it's not happening.
Could anyone help please?