Regex for all phone numbers

Tags:
PHP
Regex
I just need to get this Regex to work on all kinds of telephone numbers, it works but gives an error in addition to the message. Please help me remove only that error and leave the desired functionality intact:
function validate_phone_number( $string ) { if ( preg_match( '/^(?:(?:(?(?:00|+)([1-4]dd|[1-9]d?))?)?[-. \/]?)?((?:(?d{1,})?[-. \/]?){0,})(?:[-. \/]?(?:#|ext.?|extension|x)[-. \/]?(d+))?$/i', $string ) ) { return TRUE; } else { return FALSE; } }


Software/Hardware used:
php 5+
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: