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
07412123456 ***** **3456
(020)-2682-8673 *** ****8673
+44 (0) 1753 272 020 Ext 12 *** *** **** **2020 **
(0141) 332 7226 (After 4PM) ***** ***7226
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.