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
  • 15,221
  • 39
  • 109
  • 166

0 Answers0