Regular Expressions 101

Community Patterns

phone number


Regular Expression

(?:(\+?\d{1,3}) )?(?:([\(]?\d+[\)]?)[ -])?(\d{1,5}[\- ]?\d{1,5})


An extremely complete regex, that...

  • Accepts international phones and most of regional phone numbers;
  • Accepts phone numbers with/without "+", with/without space or "-" in the middle of the phone, and more.
  • Gets groups of all important data of the phone number (local code, country code and the phone number itself)
Submitted by @thegamerbr1 - 8 years ago