Home Tools Teams Phone Regex Builder

Microsoft Teams phone regex builder & tester

Build, test and reverse-engineer Direct Routing dial plan normalization rules. ACMA-compliant Australian recipes (Emergency · Mobile · 13 / 1300 / 1800 / 1900 · geographic · satellite · international), live regex tester with E.164 translation, bulk number checker, and human-readable regex breakdown.

This tool is provided as-is, for educational and planning purposes only. Always validate normalization rules in a Teams test tenant against a representative call sample (Operator Connect, Calling Plan, and Direct Routing all evaluate the dial plan, in that order), and confirm with your carrier's number ranges before production rollout. The Tech Space makes no warranty and accepts no liability. Full disclaimer →

Build & test a rule

The two halves of every Teams normalization rule. Pattern is a JavaScript-compatible regex (.NET regex on Teams side, but the basic syntax overlaps for this use case). Translation uses $1, $2… backreferences to capture groups in the pattern.

How Teams evaluates the dial plan Rules are matched top-to-bottom; the first matching pattern wins. Order matters — put narrow patterns (emergency, service numbers) above broad catch-alls (national, international). If no rule matches, the number is sent as-dialed which usually fails the carrier's translation.

ACMA rule library

Pre-built rules covering every class of number in the ACMA Numbering Plan. Click any card to load its pattern + translation into the builder above. These follow the canonical Teams Direct Routing convention: normalize to E.164 (+CC...) on the way out so the carrier accepts the call.

Order in Teams admin Recommended evaluation order when applying these to a dial plan: Emergency → Service Numbers (13/1300/1800/1900) → Satellite → Mobile → Geographic Local → Geographic National → International. The bottom-most rule should always be the international catch-all so an arbitrary 0011 + country code dial still translates.

Internal extension builder

Every organisation has a slightly different internal dial plan — 4-digit extensions, 5-digit extensions, site-prefix + extension, ranges reserved for hot desks, etc. Describe yours in the form below and the tool generates the matching pattern + translation. Click Load into tester to drop the generated rule into the builder above and test it against your own numbers.

How the generator interprets your inputs Whatever you enter becomes anchored with ^…$ and the extension digits become capture group $1 (or $2 if there's a site prefix in front, in which case the prefix is $1 — useful when you want to route based on site). Leading digit lists like "2 3 4" become a character class [234]. An empty first-digit list defaults to "any 1–9" (so leading zero is excluded — extensions never start with 0).

Bulk number tester

Paste a list of dialed numbers; the tester runs each through the active rule set (the loaded recipes below — initially all ACMA defaults) and reports the first matching rule + the translated E.164 output. Use this to validate user dial patterns before a Direct Routing cutover.

Regex breakdown

Paste any normalization pattern; get a token-by-token plain-English explanation. Useful for inheriting somebody else's dial plan and reverse-engineering what it intended to match.

Type a pattern above…

AU numbering reference

The Australian Communications and Media Authority (ACMA) maintains the Telecommunications Numbering Plan 2015. The table below summarises the classes that matter for a Teams Direct Routing dial plan.

Number classes (E.164 country code +61)

Class National format E.164 format Length Notes
Emergency000 / 112 / 106— (untranslated)3112 from mobile, 106 TTY. Never normalize to +61 — pass through verbatim.
Mobile04xx / 05xx xxx xxx+61 4xx / 5xx xxx xxx10 → 11ACMA allocates both 04 (primary PMTS) and 05 (newer PMTS) for mobile. Strip leading 0, prepend +61. The 05 range was added more recently and remains less common in the wild — include it for forward-compatibility.
Geographic NSW/ACT02 xxxx xxxx+61 2 xxxx xxxx10 → 11Local dial usually 8 digits inside Sydney/Canberra.
Geographic VIC/TAS03 xxxx xxxx+61 3 xxxx xxxx10 → 11Local 8 digits inside Melbourne/Hobart.
Geographic QLD07 xxxx xxxx+61 7 xxxx xxxx10 → 11Local 8 digits inside Brisbane.
Geographic WA/SA/NT08 xxxx xxxx+61 8 xxxx xxxx10 → 11Local 8 digits inside Perth/Adelaide/Darwin.
13 service13 xx xx+61 13xx xx6 → 9Local-call rate. 6 digits total.
1300 service1300 xxx xxx+61 1300 xxx xxx10 → 13Local-call rate.
1800 toll-free1800 xxx xxx+61 1800 xxx xxx10 → 13Caller pays nothing.
1900 premium1900/1901 xxx xxx+61 1900 xxx xxx10 → 13Premium rate — many enterprises block these at the SBC.
Satellite0145 xxxxxx+61 145 xxxxxx10 → 12Inmarsat / Globalstar. Less common.
International (out)0011 + CC + number+ CC + numbervariableAustralia's IDD prefix is 0011. Strip it, prepend +.

Regex syntax cheat sheet

TokenMeaningExample
^Start of string^04 matches "04…"
$End of string\d{4}$ matches "…1234"
\dAny digit (0-9)\d{8} = exactly 8 digits
{n}Exactly n times\d{6}
{n,m}Between n and m times\d{6,8}
?Optional (0 or 1)0?4 matches "04" or "4"
|Alternation (OR)(13|1300|1800)
[abc]Character class[2378]\d{7}
[a-z]Class range[2-9]\d{7}
(...)Capture group → $1, $2…^0?(4\d{8})$ + +61$1
(?:...)Non-capturing group(?:0011|\+)

References