What regex can pass all of these password patterns
At least 1 digit - Mandatory
8 characters long - Mandatory
and the password also may include (optional)
one or more uppercase or lowercase
one ore more special character
I would want both of these 2 password pattern pass
- Password@2020 / password@2020
- Password2020 / password2020
EDIT
^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}|$
This works for the second pattern i.e Password2020 / password2020 but what if I would want to allow the user to OPTIONALLY add a special character like Password@2020 / password@2020