title: Why last digit in a string is not matched by a regex group?
body: <pre><code>String line = "This order was placed for QT3000! OK?";
  String pattern = "(.*)(\\d+)(.*)";
  
  // Create a Pattern object
  Pattern r = Pattern.compile(pattern);
  
  // Now create matcher object.
  Matcher m = r.matcher(line);
  if (m.find( )) {
      System.out.println("Found value: " + m.group(0) );
      System.out.println("Found value: " + m.group(1) );
      System.out.println("Found value: " + m.group(2) );
      System.out.println("Found value: " + m.group(3) );
  
  }else {
      System.out.println("NO MATCH");
  }
  </code></pre>
  
  <p>Output:</p>
  
  <p>Found value: This order was placed for QT3000! OK?</p>
  
  <p>Found value: This order was placed for QT300</p>
  
  <p>Found value: 0</p>
  
  <p>Found value: ! OK?</p>
  
  <p>Question: I don't understand why group 2 doesn't have 300 and just 0. </p>