International Phone Number Regex

^\+?[1-9]\d{1,14}$

E.164 format international phone number validation. Supports country codes and up to 15 digits.

Test This Pattern →

Pattern Breakdown

Understanding the regex pattern ^\+?[1-9]\d{1,14}$:

  • ^ - Start of string
  • $ - End of string
  • \d - Any digit (0-9)
  • ? - Optional (zero or one)
  • + - One or more
  • [...] - Character class
  • {n,m} - Quantifier (n to m times)

Examples

Input Result Explanation
+14155551234 ✓ Match US number with country code
+442071234567 ✓ Match UK number
+8613912345678 ✓ Match China number

Code Examples

JavaScript

JavaScript
const pattern = /^\+?[1-9]\d{1,14}$/;
const text = "+14155551234";

// Test if string matches
if (pattern.test(text)) {
  console.log("Valid!");
}

// Extract matches
const matches = text.match(pattern);
console.log(matches);

Python

Python
import re

pattern = r'^\+?[1-9]\d{1,14}$'
text = "+14155551234"

# Test if string matches
if re.match(pattern, text):
    print("Valid!")

# Find all matches
matches = re.findall(pattern, text)
print(matches)

PHP

PHP
<?php
$pattern = '/^\+?[1-9]\d{1,14}$/';
$text = "+14155551234";

// Test if string matches
if (preg_match($pattern, $text)) {
    echo "Valid!";
}

// Find all matches
preg_match_all($pattern, $text, $matches);
print_r($matches);
?>

Java

Java
import java.util.regex.*;

String pattern = "^\\+?[1-9]\\d{1,14}$";
String text = "+14155551234";

Pattern p = Pattern.compile(pattern);
Matcher m = p.matcher(text);

if (m.matches()) {
    System.out.println("Valid!");
}

Use Cases

Common applications: International applications, SMS services, telephony APIs

Frequently Asked Questions

What is the regex pattern for international phone number regex?
The regex pattern is: ^\+?[1-9]\d{1,14}$. E.164 format international phone number validation. Supports country codes and up to 15 digits.
How do I use the international phone number regex pattern in JavaScript?
In JavaScript: const regex = new RegExp('^\\+?[1-9]\\d{1,14}$'); or const regex = /^\+?[1-9]\d{1,14}$/;
Does this pattern work in Python?
Yes, use: import re; pattern = re.compile(r'^\+?[1-9]\d{1,14}$') in Python. Most regex patterns are cross-language compatible.
What are common use cases for international phone number regex?
International applications, SMS services, telephony APIs

Related Regex Patterns

More Regex Tools

GetDevUtils offers a suite of developer tools including: