title: preg_match return longest match
body: <p>I am trying to return a series of numbers between 5 and 9 digits long. I want to be able to get the longest possible match, but unfortunately preg_match just returns the last 5 characters that match.</p>
  
  <pre><code>$string = "foo 123456";
  if (preg_match("/.*(\d{5,9}).*/", $string, $match)) {
      print_r($match);
  };
  </code></pre>
  
  <p>will yield results</p>
  
  <pre><code>Array
  (
  [0] =&gt; foo 123456
  [1] =&gt; 23456
  )
  </code></pre>