Test, validate and match regular expressions
Validates a line containing either a plain username (word characters only) or an email address. The email branch allows a local part with optional plus, dot, or hyphen separators, an @ symbol, a domain name, and a TLD of 2-4 letters (note the 'a-zA-z' typo also permits symbols like underscore and backtick). Typically used in login/sign-in forms to accept a username or email input, with multiline+global flags to validate multiple entries at once.