Test, validate and match regular expressions
This regex parses an IMAP ENVELOPE response string, extracting key email metadata into named capture groups. It captures the date, subject, sender, reply-to address, and recipients (TO, CC, BCC), handling both "NIL" values and parenthesized lists. It is highly useful for processing raw email server responses to easily access specific header fields.