Test, validate and match regular expressions
Validates telephone numbers in a flexible US-style format, anchored per line via ^ and $ with the gm flags. It matches a core 7-digit local number (3 digits, an optional space or hyphen, then 4 digits), optionally preceded by an area code (3 digits with optional parentheses and separator) and an international prefix (optional '+' followed by 1-4 digits). Useful for contact form validation, scraping phone numbers from multiline text, or normalizing user-entered phone input.