0

I would like to replace all punctuation from a text, except whitespaces and without splitting the text. I have tried:

text=re.sub('\W+', '', text)

but it removes whitespace. Any hint?

Mauro Gentile
  • 1,463
  • 6
  • 26
  • 37

0 Answers0