I am using this pattern for password validation.
Validators.pattern('((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!"#$%&`{|}~()*+,-.\:/;<=>?@[\]^_/']).{10,})'),
But this validation is not working for ,;() etc but working for!@#$%^&
These characters are need to be accepted-
!"#$%&'()*+,-./:;<=>?@[]^_`{|}~
Can anybody suggest where the error is?
2
Answers
This pattern is working for me-
If you have a list of special characters to match, you can create a string of escaped characters and use it to build your pattern dynamically: