擅长:python、mysql、java
<p>您可以使用<code>re.sub</code>:</p>
<pre><code>import re
s = '''"_id" : "Java code PMD Complains about Cyclomatic Complexity , of 20", "tags" : "java performance tuning pmd", "title" : "Java code PMD Complains about Cyclomatic Complexity , of 20", "results" : true, "value" : true, "processed" : true, "tokenGenerated" : [ "java", "code", "pmd", "complains" ]'''
>>> print re.sub(r'(\"[(\w)(\s)]+ )(,)( [(\w)(\s)]+\")', '\\1@@@\\3', s)
"_id" : "Java code PMD Complains about Cyclomatic Complexity @@@ of 20", "tags" : "java performance tuning pmd", "title" : "Java code PMD Complains about Cyclomatic Complexity @@@ of 20", "results" : true, "value" : true, "processed" : true, "tokenGenerated" : [ "java", "code", "pmd", "complains" ]
</code></pre>