Regex for Phone Number (EU)
Validates common European phone number formats with optional country code, area code, and various separators.
Pattern
/^\+?[1-9][0-9]{0,3}[\s.-]?\(?[0-9]{1,5}\)?[\s.-]?[0-9]{1,5}[\s.-]?[0-9]{1,5}$/ Live Tester
Enter a string to test
Examples
✓ +49 170 1234567
✓ +44 20 7946 0958
✓ 49 30 12345678
✗ +0 123 456
✗ abc
✗ ++49 170
Pattern Breakdown
^\+?[1-9][0-9]{0,3} — optional + and 1-4 digit country code (no leading zero)
[\s.-]? — optional separator (space, dot, or hyphen)
\(?[0-9]{1,5}\)? — optional area code with optional parentheses
[\s.-]?[0-9]{1,5} — separator + subscriber digits (repeated)
Code Snippets
Javascript
const regex = /^\+?[1-9][0-9]{0,3}[\s.-]?\(?[0-9]{1,5}\)?[\s.-]?[0-9]{1,5}[\s.-]?[0-9]{1,5}$/;
regex.test("+49 170 1234567"); // true Python
import re
pattern = r"^\+?[1-9][0-9]{0,3}[\s.-]?\(?[0-9]{1,5}\)?[\s.-]?[0-9]{1,5}[\s.-]?[0-9]{1,5}$"
bool(re.match(pattern, "+49 170 1234567")) # True Php
$pattern = '/^\+?[1-9][0-9]{0,3}[\s.-]?\(?[0-9]{1,5}\)?[\s.-]?[0-9]{1,5}[\s.-]?[0-9]{1,5}$/';
preg_match($pattern, "+49 170 1234567"); // 1 Related Patterns
Email Address /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ URL /^https?:\/\/(www\.)?[a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([a-zA-Z0-9()@:%_+.~#?&/=-]*)$/ Phone Number (International) /^\+?[1-9]\d{1,14}$/ Phone Number (US) /^\(?[2-9]\d{2}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/ IPv4 Address /^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/ IPv6 Address /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/