0

JSON { "data": "{"id": "123", "unit": "metric", "location": "NYC"}" }

needs to be

{ "data": "{'id': '123', 'unit': 'metric', 'location': 'NYC'}" }

basically, any double quotes inside double quotes needs to become single quote

Tried

import re
re.sub('\w[: ]*"\w','',str)

Does not work

user544079
  • 16,109
  • 42
  • 115
  • 171

0 Answers0