Mask Phone Number

Standardization Definition

Mask Phone Number
Description

The Mask Phone Number standardization definition replaces every alphanumeric character except the last four alphanumeric characters of the base number with the * character.

Examples Input Output
03 9320 2419 ** ****2419
0417 654-987 **** **4987
+61 (0)2 9876 7654 Fred`s Phone *** **** ****7654
02 69621040 (after 4pm) ** ****1040
Remarks

This definition is designed to handle single phone numbers in a valid format for the country of the locale. Invalid input may not be masked. There may be some format changes such as parenthesis removal and token separation that occurs prior to masking. Additionally, punctuation, symbols, and spaces defined by the following Unicode general categories are removed from the base number:

  • Punctuation (P)
  • Symbol (S)
  • Spaces (Z)

Additional information that is not part of the actual phone number is removed.