Regular Expression For Parsing JSON Objects : <p>I have a Json file containing text as such:</p>

<pre><code>{
    title1: {
        x: "abc",
        y: "def"
    } ,

    title2:{
        x: "{{abc}}",
        y: "{{def}}"
    },
}
</code></pre>

<p>I want to first get the title1 title2 ,... groups. And after that, for each group, I want to get the x:..., y:... parts. I try to do this in two steps. For the first step, I used the following regexp:</p>

<pre><code>[\s\S]*:\s*{(((?!}\s*,)[\s\S])*)
</code></pre>

<p>I am trying to say that find <code>:</code> followed by optional white space and then <code>{</code>. Then, continue until you see <code>}</code> followed by optional whitespace and <code>,</code>. But it finds the whole text as a match instead of title1 and title2 parts separately. What is wrong with it? </p>
