<?php$re = "/^(?!.*\\d{7}).*/m"; $str = "1234567\n123456\n12345673536"; preg_match_all($re, $str, $matches);print_r($matches);
Standard input is empty
Array ( [0] => Array ( [0] => 123456 ) )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!