I\'m having a little trouble with Python regular expressions.
What is a good way to remove all characters in a string that are not letters or numbers?
Thanks
In the char set matching rule [...] you can specify ^ as first char to mean "not in"
[...]
^
import re re.sub("[^0-9a-zA-Z]", # Anything except 0..9, a..z and A..Z "", # replaced with nothing "this is a test!!") # in this string --> 'thisisatest'