Test, validate and match regular expressions
Validates standard email addresses with an optional case-insensitive flag. The local part allows word characters separated by hyphens, plus signs, dots, or apostrophes (e.g., john.doe+tag or o'brien), followed by @, a domain with optional hyphen/dot segments, and a TLD of 2-6 alphanumeric characters. Used for form input validation and data sanitization, though it rejects newer long TLDs and some RFC 5322 special characters.