Validating telephone

Here's what I used for a client project recently, where we had to convert all phone numbers in any format to tel: links.

How are extensions (e.g., 111-222-3333 x 44444) going to be handled? Even if you could write a big, hairy validator that would allow all the different legitimate formats, it would end up allowing pretty much anything even remotely resembling a phone number in the first place.

My test script downloads a file from the internet and prints all the phone numbers in it. Maintaining a complex rule-set which could be outdated at any point in the future by any country in the world does not sound fun.

:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(? When you match,

How are extensions (e.g., 111-222-3333 x 44444) going to be handled? Even if you could write a big, hairy validator that would allow all the different legitimate formats, it would end up allowing pretty much anything even remotely resembling a phone number in the first place.

My test script downloads a file from the internet and prints all the phone numbers in it. Maintaining a complex rule-set which could be outdated at any point in the future by any country in the world does not sound fun.

:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(? When you match, $1 contains the area code, $2 and $3 contain the phone number, and $5 contains the extension. Do you foresee any need to allow square, curly, or angled brackets for some regions? If you want to maintain per digit rules (such as in US Area Codes and Prefixes (exchange codes) must fall in the range of 200-999) well, good luck to you.

Our online API can be easily integrated into website forms or mobile apps and makes sure that only valid numbers are accepted to your contact list.

Validate international phone numbers from 240 countries world-wide and get accurate status results with our phone list validator.

||

How are extensions (e.g., 111-222-3333 x 44444) going to be handled? Even if you could write a big, hairy validator that would allow all the different legitimate formats, it would end up allowing pretty much anything even remotely resembling a phone number in the first place. My test script downloads a file from the internet and prints all the phone numbers in it. Maintaining a complex rule-set which could be outdated at any point in the future by any country in the world does not sound fun. :\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(? When you match, $1 contains the area code, $2 and $3 contain the phone number, and $5 contains the extension. Do you foresee any need to allow square, curly, or angled brackets for some regions? If you want to maintain per digit rules (such as in US Area Codes and Prefixes (exchange codes) must fall in the range of 200-999) well, good luck to you.Our online API can be easily integrated into website forms or mobile apps and makes sure that only valid numbers are accepted to your contact list.Validate international phone numbers from 240 countries world-wide and get accurate status results with our phone list validator.

contains the area code, and contain the phone number, and contains the extension. Do you foresee any need to allow square, curly, or angled brackets for some regions? If you want to maintain per digit rules (such as in US Area Codes and Prefixes (exchange codes) must fall in the range of 200-999) well, good luck to you.

Our online API can be easily integrated into website forms or mobile apps and makes sure that only valid numbers are accepted to your contact list.

Validate international phone numbers from 240 countries world-wide and get accurate status results with our phone list validator.

Leave a Reply