What’s the longest possible worldwide phone number I should consider in SQL varchar(length) for phone

What’s the longest possible worldwide phone number I should consider in SQL varchar(length) for phone. considerations: + for country code () for area code x + 6 numbers for Extension extension (so make it 8 {space}) spaces between groups (i.e. in American phones +x xxx xxx xxxx = 3 spaces) here is where I need … Read more

How to validate phone numbers using regex

I’m trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following: 1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901 I’ll answer with my current attempt, but I’m hoping somebody has something better and/or more elegant. 42 … Read more