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