International Phone Number (Loose)
Match international phone numbers in a variety of loose formats including country codes, area codes, and separators.
Try it in RegexPro →Available in
JavaScript / ECMAScript code
const re = new RegExp("\\+?[1-9]\\d{0,3}[\\s.\\-]?(?:\\(?\\d{1,4}\\)?[\\s.\\-]?){2,4}\\d{1,9}", "g");
const input = "+1 (415) 555-2671";
const matches = [...input.matchAll(re)];
console.log(matches.map(m => m[0]));Uses `String.prototype.matchAll` for global iteration (Node 12+ / all modern browsers).
Python (re) code
import re
pattern = re.compile(r"\+?[1-9]\d{0,3}[\s.\-]?(?:\(?\d{1,4}\)?[\s.\-]?){2,4}\d{1,9}")
input_text = "+1 (415) 555-2671"
for m in pattern.finditer(input_text):
print(m.group(0))Stdlib `re` module — no third-party dependency. Works on Python 3.6+.
Go (RE2) code
package main
import (
"fmt"
"regexp"
)
func main() {
re := regexp.MustCompile(`\+?[1-9]\d{0,3}[\s.\-]?(?:\(?\d{1,4}\)?[\s.\-]?){2,4}\d{1,9}`)
input := `+1 (415) 555-2671`
for _, match := range re.FindAllString(input, -1) {
fmt.Println(match)
}
}Uses `regexp.MustCompile` (panics on bad patterns at startup) and `FindAllString` for all matches.
Pattern
\+?[1-9]\d{0,3}[\s.\-]?(?:\(?\d{1,4}\)?[\s.\-]?){2,4}\d{1,9} (flags: g)Raw source: \+?[1-9]\d{0,3}[\s.\-]?(?:\(?\d{1,4}\)?[\s.\-]?){2,4}\d{1,9}
How it works
Examples
Input
+1 (415) 555-2671Matches
+1 (415) 555-2671
Input
+44 20 7183 8750Matches
+44 20 7183 8750
Input
not a phoneNo match
—Common use cases
- •International contact form extraction
- •CRM data normalization across geographies
- •PII detection in documents
- •Lead generation form processing
Related patterns
International Phone (E.164)
ValidationValidate phone numbers in ITU-T E.164 international format: a + sign followed by 2–15 digits, first digit non-zero.
US Phone Number
ValidationMatch US phone numbers in common formats: (555) 867-5309, 555-867-5309, 5558675309.
IBAN (International Bank Account Number)
ValidationValidate IBAN bank account identifiers: 2-letter country code, 2 check digits, 11–30 alphanumerics.
Credit Card Number
ValidationMatch 16-digit credit card numbers with optional spaces or hyphens between groups of 4.