title: Android Java Regex Match
body: <p>I'm trying to pull out the strings:</p>
  
  <pre><code> [{"name":"John Doe Jr."},{"name2":"John Doe"}] &amp; {"name":"John Doe"} 
  </code></pre>
  
  <p>from the payload in the JSON strings below:</p>
  
  <pre><code>{"to":"broadcast", "type":"50", "payload":[{"name":"John Doe Jr."},{"name2":"John Doe"}]}
  
  {"to":"broadcast", "type":"50", "payload":{"name":"John Doe"}}
  </code></pre>
  
  <p>use this regex code:</p>
  
  <pre><code>Pattern pattern = Pattern.compile("\\{(.*?)\"payload\":\"(.*?)\"\\}\\}");
  
  Matcher matcher = pattern.matcher(jsonString);
  </code></pre>
  
  <p>I'm getting an IllegalStateException: No successfull match so far</p>
  
  <p>What is wrong with my regular expression? </p>
  
  <p>Also how to I get the number of matches it finds?</p>
  
  <p>Any help would be appreciated.</p>