$re = '/[ \t][\d]{1,6}[ \t][ \t]*\d{1,6}[ \t]*-{1}[ \t]*\d{1,6}/m';
$str = '741223-741230
741220 - 741233, ,
741223,741224
741223, 741224,
741223 -741225 , 741227-741229,740062- 740064,740065-740069, 727098
741223-741225,741227-741229,740062-740064,740065-740069';
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