I have a string as follows:
line = \"This is a text.This is another text,it has no space after the comma.\"
I want to add a space after dots and
alternatively your can also be solved without regex as follow :
>>> line = "This is a text.This is another text,it has no space after the comma."
>>> line.replace('.', '. ', line.count('.')).replace(',', ', ', line.count(','))
'This is a text. This is another text, it has no space after the comma. '
>>>