Working on a regex pattern to sanitize HTML output and remove any special characters. My thought is to write a regex listing all the characters I want to keep and remove everything else rather then trying to account for all special characters in the pattern.
My current pattern:
/[^0-9A-Za-z,=": ?'`&;>|<!.\-\/]/
It's working great, except it is removing parenthesis () which I'd like to keep. I can't seem to escape them correctly when adding to my pattern. What is the best way to do this?