I was creating a regular expression in angular to validate password which should have
- A number
- A uppercase letter
- A lowercase letter
- Only few symbols i.e !@#$%
position of any character or symbol is not restricted.
I have tried this regex
/(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z])/
But the above regex takes any special character to be valid... I just want !@#$% this to be valid ele invalid
ng-pattern?(?=.*[!@#\$%])to your regex, after your last group and before the closing/.