Test, validate and match regular expressions
Matches US telephone numbers in common formats, with an optional leading country code '1' followed by an optional space. The area code may be wrapped in parentheses, e.g. (555), or plain digits, and digit groups can be separated by hyphens or spaces (e.g., 555-555-5555, 1 555 555 5555, 1(555)555-5555). Commonly used to validate or extract American phone numbers from text. Note that the [\-|\s] character class also unintentionally allows a literal pipe as a separator.