\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|
2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|
4[987654310]|3[9643210]|2[70]|7|1)\d{1,14}$

Is the correct format for matching a generic international phone number. I replaced the US land line centric international access code 011 with the standard international access code identifier of '+', making it mandatory. I also changed the minimum for the national number to at least one digit.

Note that if you enter numbers in this format into your mobile phone address book, you may successfully call any number in your address book no matter where you travel. For land lines, replace the plus with the international access code for the country you are dialing from.

Note that this DOES NOT take into account national number plan rules - specifically, it allows zeros and ones in locations that national number plans may not allow and also allows number lengths greater than the national number plan for some countries (e.g., the US).

Answer from Eric on Stack Overflow
Top answer
1 of 16
146
\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|
2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|
4[987654310]|3[9643210]|2[70]|7|1)\d{1,14}$

Is the correct format for matching a generic international phone number. I replaced the US land line centric international access code 011 with the standard international access code identifier of '+', making it mandatory. I also changed the minimum for the national number to at least one digit.

Note that if you enter numbers in this format into your mobile phone address book, you may successfully call any number in your address book no matter where you travel. For land lines, replace the plus with the international access code for the country you are dialing from.

Note that this DOES NOT take into account national number plan rules - specifically, it allows zeros and ones in locations that national number plans may not allow and also allows number lengths greater than the national number plan for some countries (e.g., the US).

2 of 16
75

All country codes are defined by the ITU. The following regex is based on ITU-T E.164 and Annex to ITU Operational Bulletin No. 930 – 15.IV.2009. It contains all current country codes and codes reserved for future use. While it could be shortened a bit, I decided to include each code independently.

This is for calls originating from the USA. For other countries, replace the international access code (the 011 at the beginning of the regex) with whatever is appropriate for that country's dialing plan.

Also, note that ITU E.164 defines the maximum length of a full international telephone number to 15 digits. This means a three digit country code results in up to 12 additional digits, and a 1 digit country code could contain up to 14 additional digits. Hence the

[0-9]{0,14}$

a the end of the regex.

Most importantly, this regex does not mean the number is valid - each country defines its own internal numbering plan. This only ensures that the country code is valid.

^011(999|998|997|996|995|994|993|992|991| 990|979|978|977|976|975|974|973|972|971|970| 969|968|967|966|965|964|963|962|961|960|899| 898|897|896|895|894|893|892|891|890|889|888| 887|886|885|884|883|882|881|880|879|878|877| 876|875|874|873|872|871|870|859|858|857|856| 855|854|853|852|851|850|839|838|837|836|835| 834|833|832|831|830|809|808|807|806|805|804| 803|802|801|800|699|698|697|696|695|694|693| 692|691|690|689|688|687|686|685|684|683|682| 681|680|679|678|677|676|675|674|673|672|671| 670|599|598|597|596|595|594|593|592|591|590| 509|508|507|506|505|504|503|502|501|500|429| 428|427|426|425|424|423|422|421|420|389|388| 387|386|385|384|383|382|381|380|379|378|377| 376|375|374|373|372|371|370|359|358|357|356| 355|354|353|352|351|350|299|298|297|296|295| 294|293|292|291|290|289|288|287|286|285|284| 283|282|281|280|269|268|267|266|265|264|263| 262|261|260|259|258|257|256|255|254|253|252| 251|250|249|248|247|246|245|244|243|242|241| 240|239|238|237|236|235|234|233|232|231|230| 229|228|227|226|225|224|223|222|221|220|219| 218|217|216|215|214|213|212|211|210|98|95|94| 93|92|91|90|86|84|82|81|66|65|64|63|62|61|60| 58|57|56|55|54|53|52|51|49|48|47|46|45|44|43| 41|40|39|36|34|33|32|31|30|27|20|7|1)[0-9]{0, 14}$

Discussions

validation - RegEx for valid international mobile phone number - Stack Overflow
I use Clickatell to send SMSes to clients' mobile phones. Is there a standardised regular expression for all valid mobile phone numbers, e.g. +27 123 4567? I'd roll my own, but I'm worried about m... More on stackoverflow.com
🌐 stackoverflow.com
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
What is the single regex expression that checks valid phone numbers from any country?
Realistically: Won't happen without false positives. But if you have an expression for each country you can put all of them in a huge alternation: (regex for US)|(regex for Canada)|(regex for Germany)|... More on reddit.com
🌐 r/regex
10
0
September 21, 2024
Regex for Mobile Number with or without Country Code
I need to validate a text field in my registration form for which I want a Regex. The textbox will accept a mobile number like 9999999999(10 digit - starting with 7 or 8 or 9). The user may More on stackoverflow.com
🌐 stackoverflow.com
🌐
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
⚠️ If you prefer, you can use the Regex Pattern Generator online tool, but keep in mind that the RPG tool is still under development! Below are the patterns for each European country, along with a brief description. ... Description: Åland Islands phone numbers start with +358, followed by the area code "18" and then 5 more digits.
Starred by 64 users
Forked by 6 users
🌐
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.
🌐
Formulas HQ
formulashq.com › the-ultimate-guide-to-using-regex-for-phone-numbers
The Ultimate Guide to Using Regex for Phone Numbers - FormulasHQ
July 2, 2024 - For example, to match phone numbers with or without a country code, you can use the pattern “(?:\+\d{1,3})?”. This pattern matches an optional country code prefix, represented by “+”, followed by one to three digits.
🌐
O'Reilly
oreilly.com › library › view › regular-expressions-cookbook › 9781449327453 › ch04s03.html
4.3. Validate International Phone Numbers - Regular Expressions Cookbook, 2nd Edition [Book]
August 27, 2012 - The numbers should start with a plus sign, followed by the country code and national number. ... function validate(phone) { var regex = /^\+(?:[0-9] ?){6,14}[0-9]$/; if (regex.test(phone)) { // Valid international phone number } else { // Invalid ...
Authors   Jan GoyvaertsSteven Levithan
Published   2012
Pages   609
Find elsewhere
🌐
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

🌐
regex101
regex101.com › library › wZ4uU6
regex101: Regex for telephone numbers all over the world
... This regular expression is designed to validate Egyptian mobile phone numbers by ensuring they conform to the following format: Country Code: The number must start with +20, representing Egypt's international dialing code.
🌐
Pro
docs.galileo-ft.com › pro › reference › api-reference-phone-validation
Phone Validation
This table shows where to input a phone number and its country code. 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 ...
🌐
Reddit
reddit.com › r/regex › what is the single regex expression that checks valid phone numbers from any country?
r/regex on Reddit: What is the single regex expression that checks valid phone numbers from any country?
September 21, 2024 -

I would have expected this to already be done, but I can't find it from searching.

I'm looking for a single expression which can be used in something like a Google Form to check whether a phone number is valid. This is easy for one country, but I want all the countries (or maybe the ones that don't cause complications to the regex expression).

So whether the number begins with zero, or +1, or +44. All options are taken care of; so if the number is +1, then expect 10 numbers after it. Even with spaces I imagine needs to be considered.

What would the expression be?

Top answer
1 of 5
7
Realistically: Won't happen without false positives. But if you have an expression for each country you can put all of them in a huge alternation: (regex for US)|(regex for Canada)|(regex for Germany)|...
2 of 5
4
I don't have such a regex for you, sorry. But I have some comments that may be useful in figuring out what to do in your situation. Essentially, for anyone trying to do this, there are 3 options: Write a simple check that gets the basic idea and may be too lax. Google it and use what you find and hoping that's cool. (Which it seems you've done?) Or research all the phone number formats for everywhere in the world and writing your own regex that perfectly only allows correct numbers... while also still not being able to know if it's actually a real contactable number, or the person's number who is filling in the form. I suppose you're hoping someone here has happened to do that last part already for whatever reason and can just paste it in. Or someone has already googled themselves and have it bookmarked for some reason and can paste it in for you so you don't need to do more searching. Or can spend 5 seconds giving you a very basic regex check which presumably you could do but that's not good enough for what you want to use it for. In all likelihood there is no such regex because option 3 is such a huge undertaking. If it wasn't, then you'd find it with an easy Google search, because it would be used by everyone. But people do obviously validate to some degree with regex, just not to that degree... and such regexs are also easily found on Google. There's also the angle that, if you're doing this with some sort of form input component like with HTML, it's fairly likely that they have something built in for this. HTML for example lets you use the for telephone number inputs. Which has some validation, though not to the extent you're looking for because--again--that's a huge undertaking and even whole browser vendors backed by large companies do not think it's worth writing the whole thing (and perhaps the processing power it would take to run the check).
🌐
Regex Tester
regextester.com › 94779
Phone Number with Country Code - Regex Tester/Debugger
Regex Tester is a tool to learn, build, & test Regular Expressions (RegEx / RegExp). Results update in real-time as you type. Roll over a match or expression for details. Save & share expressions with others. Explore the Library for help & examples. Undo & Redo with {{getCtrlKey()}}-Z / Y. Search for & rate Community patterns. ... extended (x) extra (X) single line (s) unicode (u) Ungreedy (U) Anchored (A) dup subpattern names(J) North American Phone Number with optional country code
🌐
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 - Regex is flexible, and you can provide guidelines in a pattern that fits the type of formatting you’d like to validate. As an example, take a look at the below phone regex pattern: ... This regex pattern would allow a phone number field to be populated with any 9-digit phone number from any country code 1-3 digits long.
🌐
Regexlib
regexlib.com › Search.aspx
Search Results: 16 regular expressions found.
Regular Expression Library provides a searchable database of regular expressions. Users can add, edit, rate, and test regular expressions.
🌐
RegExr
regexr.com › 3gjfl
Get phone country code
Supports JavaScript & PHP/PCRE RegEx.
🌐
Reddit
reddit.com › r/regex › where can i find a file that contains regex patterns for validating phone numbers in every country?
r/regex on Reddit: Where can I find a file that contains regex patterns for validating phone numbers in every country?
January 6, 2024 -

There are 195 countries globally, and checking phone numbers using regex for each country can be a challenging task for any developer.

I'm looking for a JSON file with regex for all 195 countries, where each country has its regex pattern for phone number validation. An example structure might be like this:

[
  {
    "COUNTRY_NAME": "Spain",
    "REGEX": "Regex of this country should be here"
  },
  {
    "COUNTRY_NAME": "Germany",
    "REGEX": "Regex of this country should be here"
  }
] 

I'm specifically looking for a trusted source used by big companies like Google.

🌐
Quora
quora.com › What-is-the-regular-expression-for-a-valid-phone-number-without-any-country-code
What is the regular expression for a valid phone number (without any country code)? - Quora
Answer: Using RegEx against several different formats to write a phone number, with or without the country code, the following will match the area code, prefix, and postfix. [code][^a-zA-Z0-9]*[0-9]{3}[^a-zA-Z0-9]*[0-9]{3}[^a-zA-Z0-9]*[0-9]{4}$ ...
🌐
How to do in Java
howtodoinjava.com › home › java regular expressions › regex to validate international phone numbers
Regex to Validate International Phone Numbers
May 28, 2024 - The leading plus sign and the dot following the country code are required. The literal “x” character is required only if an extension is provided. ... List phoneNumbers = new ArrayList(); phoneNumbers.add("+123.123456x4444"); phoneNumbe...