title: Match string between multiple brackets
body: <p>I have this very long JSON string. I would like to filtrate it and only get the data between the first bracket. The problem is, I have many other brackets therefore my regex pattern is not working properly. </p>
  
  <p>Here is the JSON string:</p>
  
  <pre><code>    String jsondata = "["
      +"{"
        +  "test: 63453645"
          +"date: 2016-07-17"
         "{"
          + "id:534534"
          +"}"
        + "blank : null"
        + "flags : null"
       + "}"
      +"{"
        +  "test: 543564236"
          +"date: 2014-07-17"
          +"{"
          + "id:6532465"
          +"}"
        + "blank : null"
        + "flags : null"
      + "}"
      +"]";
  
      pattern = "\\{[^{}]*\\}";
      pr = Pattern.compile(pattern);  
      math = pr.matcher(jsondata);
      if (math.find()) {
          System.out.println(math.group());
      }
      else
          System.out.println("nomatch");
  </code></pre>
  
  <p>The problem with the pattern that I have is that it only prints out to the first <code>}</code> after the <code>id:</code>, but I want it to end at the last <code>}</code> which is after flags: null.</p>
  
  <p>And I only want to print the first match, i.e not the string after because the also start and end with the same character, and that is why I have an if statement instead of a while loop.</p>
  
  <p>Any suggestions? Thank you!</p>
  
  <p>Regex with multiple brackets seems like a very difficult task. Can I match the last string instead? Starting from <code>{</code> to <code>flags : null</code>?</p>