Need to set a validation for password where the use case is "Password must require 1 Upper Case, 1 Special Character and at least 6 characters"
Currently using Pattern:
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}"
However, If I enter password as John@doe - it still asks to enter a digit (number). I presume it is because of (?=.*\d)
, but if I remove this, then password is accepted without any special character.
How can I use a pattern where it asks for Special Character but not a digit (number)?