Iam using the following regular expression for password field in my project.
Problem is placement of an unescaped
- just after
+ in your character class which is in the middle and acting like a range between
0x3a. All the characters in this range are allowed due to this.
You can move
- to end of character class or at the start like this:
Also important is to change DOT (any character) in the end to allowed set of characters as I've shown above. RegEx Demo