$re = '/^(0|84)(2(0[3-9]|1[0-689]|2[0-25-9]|3[2-9]|4[0-9]|5[124-9]|6[0369]|7[0-7]|8[0-9]|9[012346789])|3[2-9]|5[25689]|7[06-9]|8[0-9]|9[012346789])([0-9]{7})$/m';
$str = '0917123123
0901123123
0931123123
0891123123
0701123123
0761123123
0771123123
0781123123
0791123123
01201123123
01211123123
01221123123
01261123123
01281123123
0911123123
0941123123
0881123123
0811123123
0821123123
0831123123
0841123123
0851123123
01231123123
01241123123
01251123123
01271123123
01291123123
0961123123
0971123123
0981123123
0861123123
0321123123
0331123123
0341123123
0351123123
0361123123
0371123123
0381123123
0391123123
01621123123
01631123123
01641123123
01651123123
01661123123
01671123123
01681123123
01691123123
0921123123
0561123123
0581123123
0521123123
01881123123
01861123123
0991123123
0591123123
01991123123
0871123123
0551123123';
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