Your regular expression is invalid. Putting a regular expression inside [] means that it must match one of the elements inside it. These two elements redefine each other, which ultimately corresponds to all. Theoretically, anything that is not a number will match any other char. available, and any spaces match any digit and any other char. also.
You can try using [^\d\s] , which says to negate the match of any digit or any space. Instead of catching everything in the original regular expression, it negates the match of both \d and \s . You can see how testing with him is here .
Walls source share