How to add one blank after period

Question:

There is a sentence. How to add one blank after period by regex in Python, between ‘glabrous’ and ‘fruit’.
I try re.sub, but still have no idea.

sent1 = ‘pistils 1.7 mm long, glabrous.fruit ellipsoid’

to

sent2 = ‘pistils 1.7 mm long, glabrous. fruit ellipsoid’

Asked By: dbelroeckk

||

Answers:

This should do it re.sub('.(?!s|d|$)', '. ', sent1)

Answered By: AnonymousFrog
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.