How the pattern works
| Part | Meaning |
|---|---|
^\+ | Starts with a plus sign |
[1-9] | Country codes never start with 0 |
\d{1,14} | Up to 14 more digits — E.164 allows 15 digits in total |
$ | End of the string, so no spaces or dashes |
Code examples
JavaScript
const re = /^\+[1-9]\d{1,14}$/;
re.test(value); // true or falsePython
import re
bool(re.fullmatch(r'\+[1-9]\d{1,14}', value))PHP
preg_match('/^\+[1-9]\d{1,14}$/', $value) === 1;
Notes and limitations
E.164 is the format Twilio, WhatsApp and most SMS APIs expect. Strip spaces, dashes and parentheses before testing, and add the country code if the user left it out.
Regex TesterType a pattern and watch matches highlight live in your test text.
Open the tool Frequently asked questions
What is the regex for international phone number (E.164)?
/^\+[1-9]\d{1,14}$/ — it matches the whole string. See the table above for what each part does.
Which examples match?
Of the examples tested, these match: +14155550199, +442071838750, +919876543210. The others don’t.
How do I test this regex?
Click “Open in Regex Tester” — the pattern, flags and sample text load automatically, and matches highlight as you edit.