Regex for US Phone Number Validation

Matches the common North American phone number formats: with or without a country code, with or without parentheses around the area code, and with dashes, spaces, or no separators at all.

This is North American Numbering Plan (NANP) format only — it won't correctly validate international numbers from other countries, which have different lengths and structures entirely. For genuinely international phone validation, a dedicated library (like Google's libphonenumber) handles the per-country rules a single regex can't.