Skip to content

e164 ​

Checks that the value is a phone number in the E.164 format: +, then 7–15 digits, the first of which is not 0.

Error codes: WRONG_E164, FORMAT_ERROR

Live example · edit rules or inputOpen in playground
rules
input
Invaliderrors
{
  "phone": "WRONG_E164"
}

The grammar is \+[1-9][0-9]{6,14}. Spaces, dashes and brackets are not allowed; remove them before:

js
{ phone: [{ remove: ' -()' }, 'e164'] }