title: Java store matches in array
body: <p>Hi I would like to store my matches in my array however constantly getting errors of nullpointer or out of bounds.</p>
  
  <pre><code>    final  String mcontentURI[] = new String[count];
      for (int i = 0; i &lt; count; i++) {
          Pattern p = Pattern.compile("src=\"(.*?)\"");
          Matcher m = p.matcher(content_val);
          if (m.find()) {
              mcontentURI[i] = (m.group(i+1));
  
  
          }
      }
  </code></pre>