Skip to content

Instantly share code, notes, and snippets.

@oshinko
Created July 27, 2017 07:03
Show Gist options
  • Save oshinko/900f6e065c540d47b40e3bcb852af56e to your computer and use it in GitHub Desktop.
Save oshinko/900f6e065c540d47b40e3bcb852af56e to your computer and use it in GitHub Desktop.
import json
import re
import sys
def repl(match):
return ':"{0}"{1}'.format(
match.group(1),
match.group(2))
text = re.sub(r':([0-9A-Za-z]+)([,}])', repl, sys.stdin.readline())
print(json.dumps(json.loads(text), indent=4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment