I would like to know how one could validate a password with regex.
I tried using lookahaed assertions but I somehow failed. I don’t know how I can match a certain length of a string.
My conditions are :
- At least 8 characters
- At least one digit
- At least one lower English letter
- At least one upper English letter
- At least one symbol of !@#$%-
- Only above characters are allowed
Thanks in advance!
you are in the right step with lookahead assertions.
Your requirements can be broken down to this :
Putting it all together you end up with this :
Which can in turn be explained by this :