0

I have a string:

'I will g go to a walk d today'

I need to convert it into:

'I will go to a walk today'

I tried to use:

re.sub(r'\b[A-Za-z0-9]\b', ' ', 'I will g go to a walk d today')

But I am getting:

'  will   go to   walk   today'

How can I exclude 'I' and 'a' from RegEx?

illuminato
  • 1,057
  • 1
  • 11
  • 33

0 Answers0