FAILURE MAP
← Case archive

FA-96367 / Phone number formatting / Member archive

E.164 parser with trunk prefixes: the first matching country code wins · case 02

"+83..." is parsed as country 8 with a national number starting with 3.

Member previewVariant 2 · 3 implementations · 11 checks per implementation

Case contract

Input [number, default region]. Toy table (cc, trunk, national lengths): DD 8/-/9, AA 42/0/9, BB 83/8/10, CC 891/-/7-8. Remove "(0)" and keep digits. A leading "+" or "00" means international: drop "00", pick the country with the longest matching code. Otherwise the region is used and a national number of a trunk country must start with its trunk, which is removed once. The national part must have an allowed length. Return "+" cc national or None.

Why this case matters

Canonical E.164 storage is the join key for calls, messaging and deduplication; one wrong prefix rule routes numbers to another country.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
international two-digit codenull"+838125550122"Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗