I have the following regular expression, which I think should match any character that is not alphanumeric, '!', '?', or '.'
re.compile('[^A-z ?!.]')
However, I get the following weird result in iPython:
In [21]: re.sub(a, ' ', 'Hey !$%^&*.#$%^&.')
Out[21]: 'Hey ! ^ . ^ .'
The result is the same when I escape the '.' in the regular expression.
How do I match the caret so that it is removed from the string as well?