$re = '/^(?=.{10,15}$)(?=.*(?:.*\d){10}.*$)([\(\)\p{Zs}.-]*[0-9]{3}[\(\)\p{Zs}.-]*[0-9]{3}[\(\)\p{Zs}.-]*[0-9]{4})$/m';
$str = '(501) 555 1234
(501)-555.1234
501-555-1234
501.555.1234
501 555 1234
501) 343-2233
(501 343-2233
(501. 343-2233
5013432233
800-..555-1234
(.8005551234
*-(.8005551234
501*555-1234
-(.80055512 41
501_555_1234
555-1234
800-...........555-1234
013432233
1. The string must be 10-15 total characters in length.
2. Must contain exactly 10 digits within string.
3. Can contain "(", ")" , " ", ".", or "-" delimiters within the string.
4. It doesn\'t matter how many delimiters are grouped as long as numbers are grouped in {3}{3}{4}.';
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