WHITESPACE = _{ " " | "\t" }
email = { cfws? ~ local_part ~ cfws? ~ "@" ~ cfws? ~ domain ~ cfws? }
local_part = { dot_atom | quoted_string }
domain = { dot_atom }
dot_atom = { dot_atom_text ~ ("." ~ dot_atom_text)* }
dot_atom_text = @{ (ASCII_ALPHANUMERIC | "!" | "#" | "$" | "%" | "&" | "'" | "*" | "+" | "/" | "=" | "?" | "^" | "_" | "`" | "{" | "|" | "}" | "~" | "-")+ }
quoted_string = @{ "\"" ~ qcontent* ~ "\"" }
qcontent = { qtext | quoted_pair }
qtext = { !("\"" | "\\") ~ ANY }
quoted_pair = { "\\" ~ ANY }
cfws = { (comment | FWS)+ }
comment = { "(" ~ (ctext | quoted_pair | comment)* ~ ")" }
ctext = { !("(" | ")" | "\\") ~ ANY }
FWS = { (WHITESPACE* ~ CRLF)? ~ WHITESPACE+ }
CRLF = _{ "\r\n" | "\n" }