Phone Number Validation & Requirements

During the data import process, GAL validates phone numbers used as a contact method. 

If the number starts with 1 and has no plus sign (+), the system assumes it's a domestic number and attempts to validate it as a US number. For example, since a number with 1 with no + would typically represent the US country code, the extra 1 is removed (e.g. 1123456789 would become 123456789). In the case of this particular number, removing the first 1 results in the number being one digit too short for an international number and it fails the first rule (that the first character should be a number 2-9) for a domestic number. 

Requirements

If the first character is a 1, do a substring to remove the leading one, then validate as a domestic number (validateDomesticPhoneNumber) 

Else If the first character is a +, validate as international (validateInternationalPhoneNumber) 

Else Attempt to validate as domestic. If that works stop. If that domestic validation fails, append a + and attempt to validate as international 

 Domestic: 

   expects '(' zero or one times 

   expects the first or second character to be 2-9 

   expects the following two characters to be 0-9 

   expects ')' zero or one times 

   allows any whitespace, period, or hyphen (' ', '.', '-') 

   expects the following three characters to be 0-9 

   allows any whitespace, period, or hyphen (' ', '.', '-') 

   expects the following four characters to be 0-9 

   allow 0-9 between 1-200 times 

ex: (234)-333-5555, 5555555555, 555.555.555, 555 555 555, 1(555 555.5555 are all valid numbers in a data feed for contact methods. 

 International: 

   expects '+' 

   expects the first character to be 1-9 

   expects the following n characters to be 0-9 

   allows '(' 

   expects the following n characters to be 0-9 

   allows ')' 

   allows '-' 

   expects the following n characters to be 0-9 

   allows '-' 

   expects the following n characters to be 0-9 

   allows . 

   expects the following n characters to be 0-9 

   allows . 

   allows any whitespace character 

   expects the following n characters to be 0-9 

   allows any whitespace character 

   allow 0 

   allow 1-9 followed by any number 0-9 or \ or - 

  allow 0-9 between 1-200 times

Note: International numbers vary greatly in length and format. The standard format is a maximum length of 15 characters. International phone number validation is difficult. Please consult various reference documents that are available to determine the correct format for your land line, mobile phone and SMS device. If you have any questions, contact support@resolver.com for assistance.