title: Regex - Find 8 digit number in string
body: <p>I want to extract 8 digit number from string using regex.</p>
  
  <p>Test strings are</p>
  
  <blockquote>
    <p><code>hi 82799162</code>, <code>236232 (82342450)</code>, <code>test data 8979</code></p>
  </blockquote>
  
  <p>Required respective output should be</p>
  
  <blockquote>
    <p><code>82799162</code>, <code>82342450</code>, <code>null</code></p>
  </blockquote>
  
  <p>I have tried following codes: </p>
  
  <ul>
  <li><code>preg_match('/[0-9]{8}$/', $string, $match);</code></li>
  <li><code>preg_match('/\d{8}$/', $string, $match);</code></li>
  </ul>
  
  <p>But it does not retrieve the number from <code>236232 (82342450)</code>.</p>