Visual regex workbench

Build, import, explain, test and share regex visually.

Regex guide

Phone Number Regex Examples

Phone number validation is one of the most common regex use cases. This guide covers practical examples for international formats, mobile numbers and E.164 validation.

Simple phone number

Accepts most common phone number formats.

Suggested pattern

^\+?[0-9\s\-()]{7,20}$
Quick test

What it matches

  • +33 6 12 34 56 78
  • (555) 123-4567

Common limitations

  • Does not validate country-specific formats.

E.164 international format

Validates E.164 international phone numbers.

Suggested pattern

^\+[1-9]\d{1,14}$
Quick test

What it matches

  • +33612345678
  • +15551234567

Common limitations

  • Requires international format with leading +.

French mobile number

Validates French mobile phone numbers.

Suggested pattern

^(\+33|0)[67]\d{8}$
Quick test

What it matches

  • 0612345678
  • +33612345678

Common limitations

  • France only.

US phone number

Validates common US phone number formats.

Suggested pattern

^\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4}$
Quick test

What it matches

  • (555) 123-4567
  • 555-123-4567

Common limitations

  • US only.

Mobile numbers only

Simple international mobile-oriented validation.

Suggested pattern

^\+?[1-9]\d{7,14}$
Quick test

What it matches

  • +33612345678
  • +447700900123

Common limitations

  • Cannot distinguish mobile and landline in all countries.

Why validate phone numbers with regex?

Phone number regex patterns help detect formatting mistakes before data is stored or processed by an application.

They are commonly used in contact forms, customer databases, CRM systems and account registration workflows.

What is the E.164 phone number format?

E.164 is the international standard for phone numbers used by many APIs, messaging services and telecommunications providers.

It represents phone numbers in a consistent format beginning with a plus sign followed by the country code and subscriber number.

International phone numbers are difficult to validate

Every country has its own numbering rules, lengths and formatting conventions.

A regex can verify general structure, but fully validating international phone numbers often requires country-specific logic.

Mobile numbers vs landline numbers

Some applications only accept mobile phone numbers, while others allow both mobile and fixed-line numbers.

Regex validation rules often differ depending on the expected type of phone number.

Formatting and user-friendly input with spaces, parentheses, dashes and other

Users frequently enter spaces, parentheses, dashes or country prefixes when typing phone numbers.

Good validation systems often normalize phone numbers before applying stricter validation rules.

Can regex verify a real phone number?

A regex can validate the format of a phone number, but it cannot determine whether the number actually exists or can receive calls.

Real verification typically requires SMS confirmation, voice verification or third-party validation services.

Best practices for phone number validation

Whenever possible, store phone numbers in a standardized international format such as E.164.

This simplifies searching, comparison, deduplication and integration with external services.