I need a regular expression for a password field.
The requirement is:
The password Must be 8 to 20 characters in length
Must contain at least one letter and one number and a special character from
!@#$%^&*()_+
.Should not start with a special character
I have tried
^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d!@#$%^&*()_+]{8,20}
It works but how do you restrict special characters from beginning the password? Also if you have a more efficient regex than the one mentioned above please suggest.
Thank you