$re = '/^(?!417500.{10}|4026.{12}|4405.{12}|4508.{12}|4844.{12}|4913.{12}|4917.{12})(?=4.{12}|4.{15}).*/m';
$str = '4123456789452
4767656752657256
4026678267543216
4175001234567865
4278908765432
4027236512341234
4844999999999999
';
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