zod icon indicating copy to clipboard operation
zod copied to clipboard

Tighten E.164 regex in regexes.ts to require a non-zero leading digit with 7-15 digits

Open Cprakhar opened this issue 3 weeks ago • 0 comments

Summary

Tightened the E.164 regex to /^\+[1-9]\d{6,14}$/ to require a non-zero leading digit while keeping the 7–15 digit constraint. Added invalid test cases for leading-zero country codes and cleaned up the E.164 test harness logging.

Tests

pnpm test (reported passing) Added the below test cases

    "+0000000", // leading zero country code
    "+0123456789", // leading zero with more digits

Related PRs:

  • #3476

Fixes: #5517

Cprakhar avatar Dec 11 '25 09:12 Cprakhar