Test, validate and match regular expressions
Matches exactly 10 digits where the first digit is 2-9, enforcing the North American Numbering Plan rule that US area codes cannot begin with 0 or 1. The ^ and $ anchors ensure the entire string is exactly ten digits with no extra characters. Commonly used to validate unformatted US phone numbers like 5551234567, so inputs containing dashes, parentheses, spaces, or a leading +1 country code will not match. Note it only validates the first digit, not the fourth digit required by a full NANP pattern.