^(\+\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
🌐
UI Bakery
uibakery.io › regex-library › phone-number
Phone number regex
This regular expression will match phone numbers entered with delimiters (spaces, dots, brackets, etc.) /^\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}$/ ... var regex = /^\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}$/; regex.test('+1 (615) 243-5172'); // returns true ... While validation of phone numbers using regex can give a possibility to check the format of the phone number, it does not guarantee that the number exists.
🌐
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 - You can also include additional checks for common things like parenthesis, dashes, or spaces. Examples like 123-456-7890, (123) 456-7890, and 123 456 7890 would all be accepted because the special characters are optional. If you want to validate a different input type, like an email address, ...
Discussions

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 - Regular expression to match standard 10 digit phone number - Stack Overflow
I see no good way to combine this ... 1,3,4|regex for 2)$ which is ugly, clumsy and makes it hard to get out the parts of the numbers. As for the area code, you can add (\+\d)? to the beginning to capture a single-digit area code (sorry, I don't know the format of your area codes). ... This code will match a US or Canadian phone number, and will also make sure that it is a valid area code ... More on stackoverflow.com
🌐 stackoverflow.com
validation - How to validate phone numbers using regex - Stack Overflow
I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following: 1-234-567-8901 1-2... More on stackoverflow.com
🌐 stackoverflow.com
Where can I find a file that contains regex patterns for validating phone numbers in every country?
https://stackoverflow.com/questions/501368/phone-number-format-and-validation-library More on reddit.com
🌐 r/regex
4
1
January 6, 2024
🌐
GitHub
gist.github.com › jengle-dev › a327f2b58e08f384ec41dbb5e5454c28
RegEx Phone Number Matching & Validation · GitHub
This 'Regular Expression' (RegEx) is used to match and validate US phone numbers in the following formats, where X represents digits (d):
🌐
ActivityInfo
activityinfo.org › support › docs › forms › validating-phone-numbers-with-regular-expressions.html
Validating phone numbers with regular expressions
Let's start by matching the Vodacom numbers. Each Vodacom mobile number starts with "81" or "82" and another digit, and then two groups of three digits: REGEXMATCH(PHONE_NUMBER, "8[12][0-9] [0-9][0-9][0-9] [0-9][0-9][0-9]")
🌐
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 - import re # Function to validate the International Phone Numbers def is_valid_phone_number(phone_number): # Regex to check valid phone number.
🌐
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

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.

Find elsewhere
🌐
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 - By using capturing groups to remember each set of digits, the same regular expression can be used to replace the subject text with precisely the format you want. ^\(?([0-9]{3})\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})$ ... Regex phoneRegex = new ...
Authors   Jan GoyvaertsSteven Levithan
Published   2012
Pages   609
🌐
Regex Tester
regextester.com › 17
Match or Validate phone number - Regex Tester/Debugger
Regular Expression to Matches a string if it is a valid phone number. It can match dashes, periods, and spaces as delimiters, country code, and supports parentheses in the area code.
🌐
RegExr
regexr.com › 3c53v
Phone Number regex
Supports JavaScript & PHP/PCRE RegEx. Results update in real-time as you type. Roll over a match or expression for details. Validate patterns with suites of Tests.
🌐
Pro
docs.galileo-ft.com › pro › reference › api-reference-phone-validation
Phone Validation
The Phone number validated column shows which number is validated against the Phone pattern regex column in the Country codes and patterns table. 📘 Note: When you pass any phone number in an endpoint request, you must also ...
🌐
AbstractAPI
abstractapi.com › api guides, tips & tricks › mastering phone number regex for efficient validation
Mastering Phone Number Regex for Efficient Validation
June 7, 2024 - Additionally, if you plan to do SMS verification, you’ll need to use an API like Twilio to handle sending automated text messages to user phone numbers after they have been validated. The primary mistake people make when using regex to validate telephone numbers is forgetting that a regex ...
🌐
Qodex
qodex.ai › home › all tools › getting started › phone number regex javascript validator
Phone Number Regex JavaScript Validator — Test Patterns
Validate phone number formats using JavaScript regex. Test international, U.S., and local patterns with real-time matching. Free, no signup.
Rating: 4.9 ​ - ​ 60 votes
🌐
Baeldung
baeldung.com › home › java › validate phone numbers with java regex
Validate Phone Numbers With Java Regex | Baeldung
January 8, 2024 - Learn how to validate different formats of phone numbers using regular expressions.
🌐
Medium
thetechplatform.medium.com › how-do-i-validate-a-phone-number-using-regex-313cb1a44408
How do I Validate a Phone Number using Regex? | by The Tech Platform | Medium
January 4, 2024 - Validating phone numbers in an application is a crucial aspect, especially considering the diverse formats and conventions they can follow. This guide aims to provide a comprehensive solution for validating United States phone numbers using regular expressions (regex) in an ASP.NET environment.
🌐
Akto
akto.io › tools › phone-number-regex-go-tester
Phone Number Regex Go Validator & Tester
Akto is the world’s best MCP and AI agent Security solution with powerful Discovery, Red Teaming, guardrails and Runtime Protection capabilities. It is the Gartner™ recognized vendor for Agentic Security.
🌐
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 - I only wanted to allow 10 digit landline numbers, but for mobile I wanted to ensure they were 11 digits. for this, I added a little code to check if the first number after the 0 (or +44) was a 7, if it was a 7, then it must be a mobile. I then had to double up on the regex, one for mobile and one for landlines.