T
ToolPrime

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

Frequently Asked Questions

What is the regex for Phone Number (EU)?
The regex pattern for Phone Number (EU) is /^\+?[1-9][0-9]{0,3}[\s.-]?\(?[0-9]{1,5}\)?[\s.-]?[0-9]{1,5}[\s.-]?[0-9]{1,5}$/. Validates common European phone number formats with optional country code, area code, and various separators.
How do I use the Phone Number (EU) regex in JavaScript?
In JavaScript you create the pattern with a regex literal or the RegExp constructor and call .test() to check a string against it. A ready-to-copy example is shown in the Code Snippets section above, alongside Python and PHP versions.
What does the Phone Number (EU) pattern match?
It matches strings like +49 170 1234567; it rejects strings like +0 123 456. See the Examples section above for the full list of matching and non-matching cases.

Related Tools