tikh_email_parser 0.1.0

Simple parser of email addresses.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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" }