Share via


Phone Normalization Rules

 

Topic Last Modified: 2010-12-14

In Lync Server 2010, the normalization rules are applied after the number is received from the Address Book Service. The Address Book Service removes any white space and non-mandatory characters from the phone number before applying the normalization rule. Examples of non-mandatory characters: !, @, ., - and *.

This processing order simplifies the normalization rules because there is no longer a need to account for the possibility of white space or non-mandatory characters in the phone number. The change in the way that numbers are formatted prior to normalization was done to be consistent with the method used for normalization in other parts of the Lync Server product. The processing order also simplifies the normalization rules that are required to properly format the number when it is presented to the client.

In prior releases, your regex rules for normalization might have looked like the following:

^\(?(\d\{3})?[\s\-\./](\d{3})[\s()\-\./](\d{4})[\s]*[x|X](\d{5})$

+1$1$2$3;ext=$4

The previous rule can be rewritten in Lync Server as the following because there is not any white space or non-mandatory characters to find:

(\d{10})[x|X](\d{5})

+1$1;ext=$2

The new processing method does have the potential to render some normalization rules that worked in previous versions of Office Communications Server to fail. Because the rule is now applied after whitespace and other specific characters are removed, a regex expression that anticipates these specific characters no longer functions as expected. For example:

\s*\(\s*\d\d\d\s*\)\s*\-\s*\d\d\d\s*\-\s*\d\d\d\d

This expressions fails because the ‘-‘ character has been removed by pre-processing. The match for ()- is no longer able to match the expected character in the input string. To resolve the previous regex to work with the new pre-processed format, you can now simplify it to the following:

\d{10}

The new regex rule simply matches ten digits.