html Regex Examples: Overly Complex Phone Number Validator: 2-Paranoid Edition

Overly Complex Phone Number Validator: 2-Paranoid Edition

A phone number validator for those who want to make sure it's really valid.

Warning: this tool is not for the faint of heart.

Example 1: Simple Phone Number Validation
			`^(\d{3})\s?\-?(\d{3})\s?\-?(\d{4})$`
			

This regex pattern will match most phone numbers in the US format.

Learn more about US phone number patterns
Example 2: International Phone Number Validation
			`^\+?\1?\d{1,4}\s?\-?\d{1,4}\s?\-?\d{1,4}$`
			

This regex pattern will match most international phone numbers.

Learn more about international phone number patterns