$re = '/([0-9][ .]?){16}/';
$str = 'Our customer usually send us some message which included their contract number. Our contract number formats are a string of 16 digits starts from 1000 (ex: 1000117030010745).
Right now our tool can recognize the contract number which are well placed using regex to find 16 digits placing right next to each other.
But the problem is, sometimes they include some special characters like dots(.), space etc... in the middle of the contract number and the number of those character are not constant. ex: 10001170.5102.1428 or 1000 11706 0056941.
Is there any regex that can matching those number out?
Thank you!';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php