#with re import re s = "string. With. Punctuation?" s = re.sub(r'[^ws]','',s) #without re s = "string. With. Punctuation?" s.translate(str.maketrans('', '', string.punctuation))