Python后置断言需要固定宽度,但是您可以尝试以下操作:
>>> s = '"It "does "not "make "sense", Well, "Does "it"'>>> re.sub(r'bs*"(?!,|$)', '" "', s)'"It" "does" "not" "make" "sense", Well, "Does" "it"'
说明:
b # Start the match at the end of a "word"s* # Match optional whitespace" # Match a quote(?!,|$) # unless it's followed by a comma or end of string



