title: getting NULL values from Java regex Matcher with a found pattern
body: <p>I'm trying to get the following regex to work on my String:</p>
  
  <pre><code>Pattern Regex = Pattern.compile("(?:(\\d+) ?(days?|d) *?)?(?:(\\d+) ?(hours?|h) *?)?(?:(\\d+) ?(minutes?|m) *?)?(?:(\\d+) ?(seconds?|s))?",
  Pattern.CANON_EQ | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
  Matcher RegexMatcher = Regex.matcher(myString);
  while (RegexMatcher.find()) {
         ...
  }
  </code></pre>
  
  <p>.. it basically splits a string like <strong>1day 3 hours</strong> into matched regex groups.</p>
  
  <p>The problem I'm having is that when I get into the while loop, calls to <code>RegexMatcher.group(i)</code> will always return a <code>NULL</code> value, meaning they were not found in the string.</p>
  
  <p>When I try to output <code>RegexMatcher.group(0)</code>, it returns an empty string, even though <code>myString</code> definitelly contains like <code>"hello 1d"</code> - which should return at least 1st group as <code>"1"</code> and second as <code>"d"</code>.</p>
  
  <p>I've checked and double-checked the regex and it seems to be ok. No Idea what's wrong here.</p>
  
  <p>Thanks for any ideas :-)</p>