我有一个字符串如下:
line = "This is a text.This is another text,it has no space after the comma."
我想在句号和逗号后面添加一个空格,以便最终结果为:
newline = "This is a text. This is another text, it has no space after the comma."
我尝试了这里的解决方案:Python Regex that adds space after dot,但它只对句点或逗号有效。我还没有掌握如何让正则表达式同时识别这两个字符。