I am writing a regex to validate the password.
Below are the password policies that i want to cover :
Password can only contain numbers,letters and special character .
Minimum length of the password is 10 and maximum length of the password is 32.
Same character should not appear consecutively 10 or more times.
First character can not be special character.
At least 2 character classes are required.(letters, numbers or special characters)
Special characters allowed -
!#+,-./:=@_
Regex that will satisfy first 4 conditions except 5th point :
^(?!.*(.)\1{7})[A-Za-z0-9][\w!#+,./:=@-]{7,23}
How i can validate all the policies together in java ?