DevTools
Back to Regex Tester

Phone Number Regex Pattern

Match international and domestic phone numbers using regex. Handles various formats with country codes, dashes, spaces, and parentheses.

The Pattern

/\+?\d{1,3}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g

How It Works

TokenMeaning
\+?Optional plus sign for country code
\d{1,3}1 to 3 digits (country code)
[-.\s]?Optional separator (dash, dot, or space)
\(?\d{1,4}\)?Optional parentheses around 1-4 digit area code
\d{1,4}1 to 4 digits (exchange)
\d{1,9}1 to 9 digits (subscriber number)

Test Cases

+1-800-555-0199Match
+44 20 7946 0958Match
(555) 123-4567Match
555.123.4567Match
abc-defgNo match
12No match

Code Examples

javascript
const phoneRegex = /\+?\d{1,3}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g;
const text = "Call +1-800-555-0199 or (555) 123-4567";
const matches = text.match(phoneRegex);
console.log(matches); // ["+1-800-555-0199", "(555) 123-4567"]
python
import re
phone_regex = r'\+?\d{1,3}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}'
text = "Call +1-800-555-0199 or (555) 123-4567"
matches = re.findall(phone_regex, text)
print(matches)  # ['+1-800-555-0199', '(555) 123-4567']

Common Use Cases

Related Patterns

Want to test this pattern with your own data?

Try this pattern in Regex Tester →