我试图用双引号替换所有单引号,但留下所有转义的单引号。有谁知道用 python 正则表达式做这个的简单方法?
Input:
"{ 'name': 'Skrillex', 'Genre':'Dubstep', 'Bass': 'Heavy', 'thoughts': 'this\'s ahmazing'}"
output:
"{ "name": "Skrillex", "Genre": "Dubstep", "Bass": "Heavy", "thoughts": "this\'s ahmazing"}"