title: Inverse match with java regex
body: <p>My input strings are like this:</p>
  
  <pre><code>foo 12
  12 foo 123
  foo 12 foo 1234
  f1o2o 12345
  foo 12 123456
  ...
  </code></pre>
  
  <p>I need capture the last number: <code>12, 123, 1234, 12345, 123456 ...</code>
  Every line is processed by separate:</p>
  
  <pre><code>Pattern p = Pattern.compile(".*([0-9]+)$");
  Matcher m = p.matcher("foo 12 123456");
  m.matches()
  </code></pre>
  
  <p>Output: <code>6</code></p>
  
  <p>Is there any form to inverse the matching? or how should I change the pattern for recover the last number?</p>