Skip to content

Phone Number Normalization

Phone number normalization is used to translate a phone number into a standard, or normal form. If numbers are not normalized, it is difficult to compare two phone numbers to see if they are the same. By changing all numbers into a normal form, MiaRec can check and handle them efficiently

The Phone Number Normalization page allows you to reformat a phone number using a web UI. To set up a new rule, navigate to Administration > System> Phone Number Normalization and click Add.

Phone Number Normalization

Fill out the following settings:

Phone Number Normalization Settings

  • REGEX pattern - is a Regular Expression to match the phone number. It may contain the groups of characters (delimited by round parentheses), which are copied to the resulting value (see substitute parameters <1>, <2> and <3> in Translation rule).
  • Translation rule - defines the phone number with substitute parameters <1>, <2> and <3> (maximum 3 substitute parameters are supported).

Example 1 : Add the prefix "1" to local USA phone numbers

([0-9]{10})

This will match any phone number, which has exactly 10 digits in length (for example, "2345678901"). Prefix "1" will be added to that phone number. For example, 2345678901 will be overwritten to 12345678901.

The expression "[0-9]{10}" matches a string, which has exactly 10 characters in length and the string contains only the digits. This expression is written in parentheses, so the value of such match can be used inside "Translation rule".

Example 2: Delete the prefix "011" from the phone number

011([0-9]{11,13})

This will match any phone number, which starts with "011" and follows 11, 12 or 13 digits after "011". `` For example, 011123456789012 will be overwritten to 123456789012. This rule just removes prefix "011" from the phone number.

The expression "[0-9]{11,13}" matches a string, which has exactly from 11 to 13 characters in length and the string contains only the digits. This expression is written in parentheses, so the value of such match can be copied to "Translation rule".

Example 3: Remove the plus sign from the phone number

\+([0-9]{1,})

This will match any phone number, which starts with '+' and follows one or more digits. For example, +1234 will be overwritten to 1234. There is a backslash before the plus sign. This is a requirement because plus sign has special meaning in REGEX. Backslash is used to disable such special meaning and to use the plus sign just as a regular character.

The expression "[0-9]{1,}" matches a string, which has at least one digit character (maximum length is not limited. It can be 1, 2 or any other number of digits).