我有一个字符串,
line = '12/08/2013,3,"9,25",42:51,"3,08","12,9","13,9",159,170,"3,19",437,'
我想用“:”查找并替换引号之间的逗号。寻找结果
line = '12/08/2013,3,9:25,42:51,3:08,12:9,13:9,159,170,3:19,437,'
到目前为止,我已经能够将这种模式与,
import re
re.findall('(\"\d),(.+?\")', line)
但是,我想我应该使用
re.compile(...something..., line)
re.sub(':', line)
有谁知道如何做到这一点?谢谢,实验室迷