Test, validate and match regular expressions
Matches US-style phone numbers with an optional parenthesized area code, an optional 3-digit prefix, and a required 4-digit line number, supporting 7 or 10 digit forms like (555)1234567, 5551234567, or 1234567. Three capture groups extract the area code, prefix, and line number for separate processing. The global and multiline flags allow finding all matches across every line of input text.