^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$

Matches the following

123-456-7890
(123) 456-7890
123 456 7890
123.456.7890
+91 (123) 456-7890

If you do not want a match on non-US numbers use

^(\+0?1\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$

Update :
As noticed by user Simon Weaver below, if you are also interested in matching on unformatted numbers just make the separator character class optional as [\s.-]?

^(\+\d{1,2}\s?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$

https://regex101.com/r/j48BZs/2

Answer from Ravi K Thapliyal on Stack Overflow
Top answer
1 of 16
408
^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$

Matches the following

123-456-7890
(123) 456-7890
123 456 7890
123.456.7890
+91 (123) 456-7890

If you do not want a match on non-US numbers use

^(\+0?1\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$

Update :
As noticed by user Simon Weaver below, if you are also interested in matching on unformatted numbers just make the separator character class optional as [\s.-]?

^(\+\d{1,2}\s?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$

https://regex101.com/r/j48BZs/2

2 of 16
247

There are many variations possible for this problem. Here is a regular expression similar to an answer I previously placed on SO.

^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$

It would match the following examples and much more:

18005551234
1 800 555 1234
+1 800 555-1234
+86 800 555 1234
1-800-555-1234
1 (800) 555-1234
(800)555-1234
(800) 555-1234
(800)5551234
800-555-1234
800.555.1234
800 555 1234x5678
8005551234 x5678
1    800    555-1234
1----800----555-1234

Regardless of the way the phone number is entered, the capture groups can be used to breakdown the phone number so you can process it in your code.

  • Group1: Country Code (ex: 1 or 86)
  • Group2: Area Code (ex: 800)
  • Group3: Exchange (ex: 555)
  • Group4: Subscriber Number (ex: 1234)
  • Group5: Extension (ex: 5678)

Here is a breakdown of the expression if you're interested:

^\s*                #Line start, match any whitespaces at the beginning if any.
(?:\+?(\d{1,3}))?   #GROUP 1: The country code. Optional.
[-. (]*             #Allow certain non numeric characters that may appear between the Country Code and the Area Code.
(\d{3})             #GROUP 2: The Area Code. Required.
[-. )]*             #Allow certain non numeric characters that may appear between the Area Code and the Exchange number.
(\d{3})             #GROUP 3: The Exchange number. Required.
[-. ]*              #Allow certain non numeric characters that may appear between the Exchange number and the Subscriber number.
(\d{4})             #Group 4: The Subscriber Number. Required.
(?: *x(\d+))?       #Group 5: The Extension number. Optional.
\s*$                #Match any ending whitespaces if any and the end of string.

To make the Area Code optional, just add a question mark after the (\d{3}) for the area code.

🌐
Medium
medium.com › @davidlindercodes › the-ultimate-regex-for-verifying-uk-phone-numbers-fd99db881753
The Ultimate REGEX for verifying UK phone numbers | by David Linder | Medium
December 28, 2022 - This code ONLY allows for 11 digit numbers, however, in the UK 10 digit numbers are still common place. This code does not allow for trailing spaces. There is no reason why a legit UK phone number should be rejected just because the user put a blank space after it.
Discussions

REGEX Tutorial to Validate US Phone Numbers
Hi everyone, I wanted to create this discussion post to share a methodology I created using Domo's Regular Expressions in Magic ETL to parse and validate US phone numbers. This validation process follows the basic standards set by the North American Numbering Plan (NANP) and helps identify ... More on community-forums.domo.com
🌐 community-forums.domo.com
March 26, 2025
help with regex validation for worldwide email, phone numbers and address
Create a short answer question for the phone number. Click on the three dots (⋮) at the bottom right of the question field and select "Response validation." In the dropdown that appears, select "Regular expression." Choose "Matches" from the next dropdown. Paste the regex pattern into the text field. Add a custom error message if desired, such as "Please enter a valid phone number starting with a + followed by the country code and number." ^\+([0-9]{1,4})[-\s]?([0-9]{1,15})$ This regex should cover a wide range of international phone numbers, but keep in mind that certain country-specific formatting might not be fully captured due to the flexibility required for worldwide usage. If you encounter any specific cases where the regex fails, you may need to adjust the pattern slightly. More on reddit.com
🌐 r/GoogleForms
3
2
July 31, 2024
REGEX to extract phone number from Text
Hi Makers, I’m trying to extract a phone number from a text. I tried multiple Regular Expressions but it does not match any pattern. Here is one of the Regex I used : /+?\d{1,4}?[-.\s]?(?\d{1,3}?)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g I want to retrieve this kind of phone number from ... More on community.make.com
🌐 community.make.com
8
1
September 22, 2022
Get valid phone numbers using Regex
Hi I have a requirement where I want to fetch only valid phone numbers from India…how can I do this using Regex? More on forum.uipath.com
🌐 forum.uipath.com
7
0
February 3, 2025
🌐
UI Bakery
uibakery.io › regex-library › phone-number
Phone number regex
A simple regex to validate string against a valid international phone number format without delimiters and with an optional plus sign: ... // Validate phone number const validatePhoneNumberRegex = /^\+?[1-9][0-9]{7,14}$/; validatePhoneNumberRegex.test('+12223334444'); // Returns true // Extract ...
🌐
Domo
community-forums.domo.com › home › community forums › magic etl
REGEX Tutorial to Validate US Phone Numbers - Domo Community Forum
March 26, 2025 - Hi everyone, I wanted to create this discussion post to share a methodology I created using Domo's Regular Expressions in Magic ETL to parse and validate US phone numbers. This validation process follows the basic standards set by the North American Numbering Plan (NANP) and helps identify valid US phone numbers from a…
🌐
Reddit
reddit.com › r/googleforms › help with regex validation for worldwide email, phone numbers and address
r/GoogleForms on Reddit: help with regex validation for worldwide email, phone numbers and address
July 31, 2024 -

Hello, posting here in case someone can help. I need to add some sort of data validation in google forms for international phone numbers, the rules I have are:

The numbers should start with a plus sign ( + )
It should be followed by Country code and National number 1 to 4 digits between 0 and 9
It may contain white spaces or a hyphen ( – ).
the length of phone numbers may vary from 7 digits to 15 digits.

The form is going to be available to people that are based worldwide so it needs to be flexible enough to cover most countries. I've searched online extensively as this is quite common but my phone numbers keep getting errors, anyone has one that works? Thank you

Find elsewhere
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Regular_expressions
Regular expressions - JavaScript | MDN
1 month ago - For example, the following regular expression might be used to match against an arbitrary unicode "word": ... Unicode regular expressions have different execution behavior as well. RegExp.prototype.unicode contains more explanation about this. ... In the following example, the user is expected to enter a phone number...
🌐
Avaya
documentation.avaya.com › bundle › IPOfficeMSTeamsDirectRouting › page › Telephone_Number_Examples.html
Regex Telephone Number Examples
Skip to main contentSkip to search · Powered by Zoomin Software. For more details please contactZoomin · Log in to get a better experience · Login · Stay Connected · SitemapTerms of UsePrivacyCookiesTrademarksAccessibility
🌐
GitHub
github.com › mnestorov › regex-patterns
GitHub - mnestorov/regex-patterns: This repository contains regular expression (regex) patterns for validating phone numbers postal codes, VAT numbers, dates, currency, credit/debit cards etc. for European countries (but not only). · GitHub
This repository contains regular expression (regex) patterns for validating phone numbers, postal codes, VAT numbers and some common and critical in various applications patterns like date, currency, credit and debit cards etc.
Starred by 64 users
Forked by 6 users
🌐
O'Reilly
oreilly.com › library › view › regular-expressions-cookbook › 9781449327453 › ch04s02.html
4.2. Validate and Format North American Phone Numbers - Regular Expressions Cookbook, 2nd Edition [Book]
August 27, 2012 - These formats include 1234567890, 123-456-7890, 123.456.7890, 123 456 7890, (123) 456 7890, and all related combinations. If the phone number is valid, you want to convert it to your standard format, (123) 456-7890, so that your phone number ...
Authors   Jan GoyvaertsSteven Levithan
Published   2012
Pages   609
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › validate-phone-numbers-with-country-code-extension-using-regular-expression
Validate Phone Numbers ( with Country Code extension) using Regular Expression - GeeksforGeeks
July 23, 2025 - Use Pattern class to compile the regex formed. Use the matcher function to check whether the Phone Number is valid or not. If it is valid, return true. Otherwise, return false. Below is the implementation of the above approach: ... #include <bits/stdc++.h> #include <regex> using namespace std; // Function to validate the // International Phone Numbers string isValidPhoneNumber(string phonenumber) { // Regex to check valid phonenumber.
🌐
UI Bakery
uibakery.io › regex-library › phone-number-python
Phone number regex Python
# Validate phone number import re validate_phone_number_pattern = "^\\+?[1-9][0-9]{7,14}$" re.match(validate_phone_number_pattern, "+12223334444") # Returns Match object # Extract phone number from a string extract_phone_number_pattern = "\\+?[1-9][0-9]{7,14}" re.findall(extract_phone_number_pattern, 'You can reach me out at +12223334444 and +56667778888') # returns ['+12223334444', '+56667778888'] This regular expression will match phone numbers entered with delimiters (spaces, dots, brackets, etc.)
🌐
ActivityInfo
activityinfo.org › support › docs › forms › validating-phone-numbers-with-regular-expressions.html
Validating phone numbers with regular expressions
In the DRC, the numbering scheme for mobile phones is as follows: ... Celltell: 97X XXX XXX, 98X XXX XXX. or 99X XXX XXX · Where "X" is any digit, 0-9. We can use the patterns above to write a validation rule that tests for a valid mobile number. Let's start by matching the Vodacom numbers.
🌐
GitHub
gist.github.com › jengle-dev › a327f2b58e08f384ec41dbb5e5454c28
RegEx Phone Number Matching & Validation · GitHub
Share Copy sharable link for this gist. Clone via HTTPS Clone using the web URL. ... Clone this repository at &lt;script src=&quot;https://gist.github.com/jengle-dev/a327f2b58e08f384ec41dbb5e5454c28.js&quot;&gt;&lt;/script&gt; Save jengle-dev/a327f2b58e08f384ec41dbb5e5454c28 to your computer and use it in GitHub Desktop. ... This 'Regular Expression' (RegEx) is used to match and validate US phone numbers in the following formats, where X represents digits (d):
🌐
Trestle
trestleiq.com › home › product › phone validation regex: the what, how, and pros and cons
Phone Validation Regex: The What, How, and Pros and Cons
September 24, 2025 - For example, a simple check, like if the phone is 10 or 11 digits and only contains specific or special characters, is an easy way to check that the number provided is valid. Without a high degree of confidence, time and resources are wasted on chasing down leads or reaching out to individuals with bad data. This can be done using what we call regex in a programming language. While regex (regular expression...
🌐
RegExr
regexr.com › 3c53v
Phone Number regex
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.
🌐
UI Bakery
uibakery.io › regex-library › phone-number-csharp
Phone number regex C#
using System.Text.RegularExpressions; ...-.\\s]?\\(?\\d{1,3}?\\)?[-.\\s]?\\d{1,4}[-.\\s]?\\d{1,4}[-.\\s]?\\d{1,9}$"); validatePhoneNumberRegex.IsMatch("+1 (615) 243-5172"); // returns True } } ... While validation of phone numbers using regex can give a possibility to check the format ...