Sample Normalization Rules

I promised an one of my classes that I would post these sample rules a few months ago, and I totally forgot to do it. Anyways, here it is.

Number Input Phone Number Pattern Translation Pattern Output  
54444 ^5(\d{4})$ +1425555$1 +14255554444 This rule is for five digit dialing for numbers that start with 5. It strips the 5, and adds the preceding numbers.
52345678 ^5(\d{7})$ +1425$1 +14252345678 This rule is for seven digit dialing for numbers that requires an 8 to be dialed first. It strips the 8 and adds the preceding numbers.
4252345678 ^(\d{10})$ +1$1 +14252345678 This rule is for ten digit dialing.
94252345678 ^9(\d{10})$ +1$1 +14252345678 This rule is for ten digit dialing that requires an 9 to be dialed first. It strips the 9.
4692345678 ^(972|214|469)(\d{7})$
OR
^(972\d{7}|214\d{7}|469\d{7})$
+1$1 +14692345678 This rule is for ten digit dialing that requires a 9 to be dialed first and is applied when the first three digits are either 972, 214, or 469.
9722345678 ^(972|214|469)(\d{7})$
OR
^(972\d{7}|214\d{7}|469\d{7})$
+1$1 +19722345678 This rule is for ten digit dialing that requires a 9 to be dialed first and is applied when the first three digits are either 972, 214, or 469.
2142345678 ^(972|214|469)(\d{7})$
OR
^(972\d{7}|214\d{7}|469\d{7})$
+1$1 +12142345678 This rule is for ten digit dialing that requires a 9 to be dialed first and is applied when the first three digits are either 972, 214, or 469.
0 ^0$ +14255550000$1 +14255550000 This rule is for dialing a particular number when somebody dials 0.
911 ^([2-9])11$ $1 911 This rule is used for dialing three digit service numbers that end in 11.
411 ^([2-9])11$ $1 411 This rule is used for dialing three digit service numbers that end in 11.
511 ^([2-9])11$ $1 511 This rule is used for dialing three digit service numbers that end in 11.

 

For more information on normalization, I highly recommend visiting Jeff Shertz’ blog at http://blogs.pointbridge.com/Blogs/schertz_jeff/Pages/Post.aspx?_ID=26.

I love the rule and the explanation that he wrote for it that handles almost all US phone numbers for address book normalization. Remember, the address book normalization is not the same as the rules that we create for location profiles even though both use regular expressions and the concepts are very similar.

Advertisements
This entry was posted in Office Communications Server. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s