Related to this question Regex to match commas that are not in an array (enclosed in square brackets) I found I want to match commas outside of curly brackets.
The solution to that question was ,(?![^[]*\])
. I am trying a similar regex, ,(?![^{]*\})
, for my problem.
What I found with this regex I am trying is that it doesn't match the third comma in this example, {"A": "B", "C":{"D":"E"}, "F": {"G"}, "H":"I"}
. For some reason it does not match the last comma after the closing curly bracket following the letter G.
The example online: https://regex101.com/r/4YXKqJ/1