How do I match something that is not a letter, number, or space?
1 answer
Your pattern /[^[:alnum:]]*/
matches 0 or more characters other than alphanumeric characters. It will match a blank.
To match 1 or more characters other than alphanumeric and whitespace, you can use
/[^[:alnum:][:space:]]+/
Use a negative parenthesis expression with the appropriate POSIX character classes inside.
+1
source to share