Created
February 6, 2015 09:26
-
-
Save teebot/d063f80ba1913a4a40cd to your computer and use it in GitHub Desktop.
Regex replace a JSON dictionary by an array of objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"BE":"Belgium"}, {"IT":"Italia"} | |
to | |
[{ "code": "BE", "name": "Belgium"}, { "code": "IT", "name": "Italia"}] | |
replace this ([^{},:]*):([^{},:]*) | |
with this : { "code":$1, "name": $2 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment