Reputation: 231
Here's the Regex:
^[^~^\\/&$-+]*$
Here's the test string:
a(b
Even though (
doesn't appear in the blacklist, this returns NO matches. That makes NO sense. Anyone know why?
Upvotes: 0
Views: 379
Reputation: 31025
You have to put the dash at the end of the character class:
Change from:
^[^~^\/&$-+]*$
^---- Here the dash works as a range instead of a single character
To
^[^~^\/&$+-]*$
^--- Here works as the single "-" character
Btw, as Mr. Lama pointed in his comment you can also escape the dash like this:
^[^~^\/&$\-+]*$
^-- escaped here
Upvotes: 1