title: Regular expressions: some groups missing
body: <p>I have following Java code:</p>
  
  <pre><code>String s2 = "SUM   12  32 42";
  Pattern pat1 = Pattern.compile("(PROD)|(SUM)(\\s+(\\d+))+");
  Matcher m = pat1.matcher(s2);
  System.out.println(m.matches());
  System.out.println(m.groupCount());
  for (int i = 1; i &lt;=  m.groupCount(); ++i) {
          System.out.println(m.group(i));
  }
  </code></pre>
  
  <p>which produces:</p>
  
  <pre><code>true
  4
  null
  SUM
   42
  42
  </code></pre>
  
  <p>I wonder what's a <code>null</code> and why 12 and 32 are missing (I expected to find them amongst groups).</p>