title: Ignoring regex at end of string
body: <p>I have an invalid JSON response like this:</p>
  
  <pre><code>{"a": 1, "b": {...}}{"x": 2, "y": 3}
  </code></pre>
  
  <p>I'm unable to fix the source, so I have to fix it on my end.</p>
  
  <p>I want to extract out only this JSON chunk: <code>{"a": 1, "b": {...}}</code></p>
  
  <p>It's because it's appending a second chunk of metadata JSON <code>{"x": 2, "y": 3}</code> that I want to ignore.</p>
  
  <p>How do I format my regex to either</p>
  
  <p>a) only take the first JSON blob (up until the space right before the last <code>{</code>)</p>
  
  <p>b) strip out the last JSON chunk (I would say look for the last <code>{</code> in the string so I can split right before it.</p>
  
  <p>Method B is probably easiest</p>