canceraiddev / elm-form-builder / Form.Format.Phone

Mobile phone number regular expressions and formatting.

Phone Regexes

mobileRegex : Form.Locale.CountryCode.CountryCode -> Regex

The numbers to accept based on country.

landlineRejectRegex : Form.Locale.CountryCode.CountryCode -> Regex

The landline numbers to reject (we only accept mobile numbers) based on country.

Phone Formatting

formatForSubmission : Form.Locale.CountryCode.CountryCode -> String -> String

formatForDisplay : Form.Locale.CountryCode.CountryCode -> String -> String

The groupings of digits for phone numbers