Phone number regex pattern

Copy and test a JavaScript regex for approximate phone number matching, with examples, limitations, and a one-click link to the regex tester.

Phone number regex pattern

Validate whole value

Use anchors to check whether the complete value matches.

Regex: ^\+?[0-9()\-.\s]{7,20}$

Flags: -

Search in text

Find matching fragments inside a larger block of text.

Regex: (?:\+?\d[\d()\-.\s]{6,}\d)

Flags: g

Examples that match

  • +1 (555) 123-4567
  • 020 7946 0958

Examples that do not match

  • 123
  • phone-number

Limitations

Phone number matching is approximate and may find unrelated numeric fragments.