RE: How to remove whitespaces and newlines from every value in a JSON file?
I want to do the opposite, and ignore values or groups but remove all whitespace from the structure of a JSON, for example:
Input:
{
"1": "This is a string",
"AnInt": 123,
"3": [6, 9, 429]
}
Goal Output:
{"1":"This is a string","AnInt":123,"3":[6,9,429]}
I can get close with
\s+(?=(?:[^"]*"[^"]*"[^"]*)*$)
but it does't remove the spaces in and around the group in 3
When I modify the REGEX to capture around the square brackets for groups it breaks completely \s+(?=(?:[^"]*"[^"]*"[^"]*)*$)*(?=(?:[^[]*[[^[]*][^]]*)*$)*