Skip to content

Instantly share code, notes, and snippets.

@Guillergood
Last active September 29, 2020 06:26
Show Gist options
  • Save Guillergood/803db79c4502c5624d0df87933b4de39 to your computer and use it in GitHub Desktop.
Save Guillergood/803db79c4502c5624d0df87933b4de39 to your computer and use it in GitHub Desktop.
"regreplace.commands": [
{
"name": "JSON cleaner",
"match": "\\.json?$",
"regexp": "((,)*(\n)*( )*?(\t)*?)\".*?\"( )*: (\\[( )*\\]|\\{( )*\\})|(((\n)*( )*?(\t)*?)\".*?\"( )*: (\\[( )*\\]|\\{( )*\\})(,)*(\n)*)",
"global": true,
"replace": ""
},
{
"name": "Empty properties",
"match": "\\.json?$",
"regexp": "\"(?![\t ]*(title|replace|namespace)).*\"( )*: (\"( )*\")(,)*(\n)*",
"global": true,
"replace": ""
},
{
"name": "Edge cases",
"match": "\\.json?$",
"regexp": "(\\{()*,)|(,(\t )*)}",
"global": true,
"replace": "{"
},
{
"name": "Edge cases 2",
"match": "\\.json?$",
"regexp": ",[ \t\n]+\\}",
"global": true,
"replace": "\n}"
}
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment