$re = '~^\+\d{1,4}(( |\(| \(|-)?\d{1,4}( |\)|\) |-)?)?(\d{2} )?\d{2,4}[- ]?\d{2,3}[- ]?\d{0,2}$~ms';
$str = '+22-22-222-2222
+777(777)777-777
+666-66-666-6666
+9(999)999-9999
+444-444-444
+555(555)555-555
+0(000)000-0000
+1(111)111-1111
+11(111)111-1111
+111-11-111-111
+666-666-6666
+99 999 999 999
+77(777)777-7777
+999-99-999-99-99
+8(888)888-8888
+333-3333-3333
+000-00-000-000
+7(777)777-7777
+111(11)111-11-11
+55 555 55 55 55
+222-222-2222
+888-88-88-8888
+4(444)444-4444
+333-3-333-333
+555-5-555-5555
+555-55-5555
+666-66-666-666
+55-55-5555-5555
+999-999-9999
+5(555)555-5555
+666-666-6666
+111(111)111-111
+666-66-66-6666
+666-66-66-6666
+666-66-666-666
+000-0000-0000
+2 (222) 222-2222
+111(111)11-11
+999-999-9999
+0(000)000-0000
+555-55-55-5555
+444-44-44-44-44
+88-8-8888-8888
+11 11-11111111
+77(777)777-7777
+111-11-11111
+666(666)666-666
+999-99-999-9999
+777-77-777
+111 1111-1111
+666-66-666-666
+555-55-555-555
+33-3-333-3333
+666-666-6666
+222-22-222-222
+666(666)666-666
+55 55 55 55 55
+888-88-88-88-88
+5(555)555-5555
+7(777)777-7777
+111-1-111-1111
+66(666)666-6666
+111 1111-1111
+666-66-666-6666
+333-3-333-333
+000-000-0000
+222-22-222-2222
+666-66666
+777-777-777
+666-66-66666
+222 22 222 22 22
+33 3 33 33 33 33
+333-33333-3333
+777-77-77-77
+999-9-99-99-99
+555(555)55-55
+666(666)666-666
+55 555 5555555
+000(000)000-000
+000-000-00000
+55(555)555-5555
+444-44-44-44
+5(555)555-5555
+5(555)555-5555
+111 1111-1111
+444-44-444-444
+555-5-555555
+222-222-2222
+333 3333-3333
+000-0000-0000
+666 6666 6666
+88(888)888-888
+222 222 2222
+22 22222-22222
+77-77-777-77
+11(111)111-1111
+333(333)333-3333
+111 11 1111111
+999-9-999-9999
+99 999 999999
+7(777)777-7777
+99 999 99 9999
+000-0-0000-0000
+2 222 222-22-22
+444-444-444444
+222-22-222
+777-7777-7777
+111(111)111-111
+000-00-000-000
+444-44-444-444
+999-9-999-999
+111-1-111-1111
+888-88-888-888
+666-66-666-666
+333(333)333-3333
+666(666)66-666
+222(222)222-222
+111-1111-1111
+999-99-999-999
+222-22-22-22222
+555-5-5555-5555
+33 33-3333-3333
+000-000-0000
+222-22-22-2222
+333-3333-3333
+555-555-5555
+555(555)55-55-55
+111-11-11-1111
+777-777-7777
+11-11-11-1111
+999-999-9999
+666-6666-6666
+444-44-444-444
+111-11-11-1111
+999-99-999-999
+0(000)000-0000
+333-33-3333-333
+333-33-333-333
+33-333-333
+888-88-888-8888
+333-333-3333
+777-77-777-777
+44 44 44444444
+888-88-8888
+44 444-444-4444
+777-7777-7777
+444-44-44-4444
+222-22-222-22
+222-2222
+333-333-333
+222-222-222
+2(222)222-2222
+66 666 66 666
+666-66-666-666
+44 444-4444444
+666-666-6666
+555-55-555-5555
+000-000-0000
+666(666)66-666
+222(222)222-222
+44(444)444-444
+11 111 1111
+88 888-888-888
+222-22-222-2222
+111-1111-1111
+888-88888-8888
+99-99-999-9999
+2 222 222-22-22
+999(999)999-999
+4(444)444-4444
+6(666)666-6666
+2(222)222-2222
+999-99-9999
+111-1111-111111
+777-77-77777
+222-2-222-2222
+222-22-222-2222
+555-55-555-5555
+222-2-222-222
+222-22-222222
+11 1111-1111
+2(222)222-2222
+111(111)111-111
+777-77-777-777
+777-77777
+777-7-777-777
+99-99-999-9999
+44-44-444-4444
+222-22-222-2222
+77 777 777 777
+55-55-555-5555
+555-55-555-5555
+444-444-444
+999-99-99-9999
+77 77 777 77 77
+55 55 555 55 55
+999-99-9999-999
+999-9999-9999
+888-88-888-8888
+333-33-333-3333
+44-44-444-444
+222-222-2222
+777-77-777-777
+777-7777
+333-33333
+5(555)555-5555
+444-44-444-444
+44 444 444 44 44
+777-7-777-7777
+1(111)111-1111
+222-22222
+2(222)222-2222
+111(111)111-111
+000(00)000-00-00
+000-0-000-0000
+77 7777 777777
+2 (222) 222-2222
+666-6-666-66-66
+666-66-666-6666
+111-11111
+11 11 1111 1111
+00(000)000-0000
+33-33-3333-333
+444-44-4444
+444-4-444-444
+888-88-888-8888
+555-5-555555';
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