Test, validate and match regular expressions
Matches the start of a North American phone number, capturing a valid NANP area code: first digit 2-9, second digit 0-8, and third digit 0-9. It allows an optional opening parenthesis before the digits, such as '(212'. With the multiline flag, ^ anchors each match to the start of a line, and the global flag finds all occurrences. Commonly used to validate or extract the area code portion of US/Canadian phone numbers.