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’
>Solution :
This should do it re.sub('\.(?!\s|\d|$)', '. ', sent1)