fork download
  1. import re
  2. mystr = '["key": val, "key2": val, "key3": v, "key5": 34, "key6": "ef"]'
  3. key_pattern = '"(\w+)"(?=:)'
  4. print(re.sub(key_pattern, r"\1", mystr))
Success #stdin #stdout 0.02s 9644KB
stdin
Standard input is empty
stdout
[key: val, key2: val, key3: v, key5: 34, key6: "ef"]