Regex for phone numbers

Phone numbers in the US and Canada consist of ten digits: a three-digit area code, a three-digit central office code, and a four-digit line number. These components may be separated by dashes, spaces, or dots; the area code is often written in parentheses: 619-555-0167 (619) 555-0167 619.555.0167 There are some limits on the area code: the area code cannot start with 0 or 1 (these digits are used…