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,299
  • 5
  • 23
  • 34

0 Answers0