Regex tester / pattern library

Regex: phone number (international)

/^\+?[1-9]\d{6,14}$/ Test it live

How it works

E.164 shape: optional +, then 7–15 digits not starting with 0. Strip spaces, dashes, and parentheses before testing — normalizing first beats a regex that tries to accept every formatting style.

Honest caveats

Phone validation by regex is inherently shallow: real rules vary per country and change. For anything user-facing, use a library like libphonenumber; this pattern is the sanity check, not the validator.

Matches

  • +905321234567
  • 14155552671
  • +442071838750

Doesn't match

  • +0123456
  • 532 123 45 67
  • 12345

More patterns