Pull merge.
[yaffs-website] / vendor / egulias / email-validator / documentation / RFC5322BNF.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3
4 <head>
5 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
6 <title>The BNF from RFC 5322 defining parts of a valid internet message address</title>
7 </head>
8
9 <body>
10 <pre style="font-size:11px;">
11    addr-spec       =   local-part "@" domain
12
13    local-part      =   dot-atom / quoted-string / obs-local-part
14
15    dot-atom        =   [CFWS] dot-atom-text [CFWS]
16
17    CFWS            =   (1*([FWS] comment) [FWS]) / FWS
18
19    FWS             =   ([*WSP CRLF] 1*WSP) /  obs-FWS
20                                           ; Folding white space
21
22    WSP             =   SP / HTAB          ; white space
23
24    obs-FWS         =   1*([CRLF] WSP)     ; As amended in erratum #1908
25
26    ctext           =   %d33-39 /          ; Printable US-ASCII
27                        %d42-91 /          ;  characters not including
28                        %d93-126 /         ;  "(", ")", or "\"
29                        obs-ctext
30
31    obs-ctext       =   obs-NO-WS-CTL
32    ccontent        =   ctext / quoted-pair / comment
33
34    comment         =   "(" *([FWS] ccontent) [FWS] ")"
35
36    dot-atom-text   =   1*atext *("." 1*atext)
37
38    atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
39                        "!" / "#" /        ;  characters not including
40                        "$" / "%" /        ;  specials.  Used for atoms.
41                        "&amp;" / "'" /
42                        "*" / "+" /
43                        "-" / "/" /
44                        "=" / "?" /
45                        "^" / "_" /
46                        "`" / "{" /
47                        "|" / "}" /
48                        "~"
49
50    specials        =   "(" / ")" /        ; Special characters that do
51                        "&lt;" / "&gt;" /        ;  not appear in atext
52                        "[" / "]" /
53                        ":" / ";" /
54                        "@" / "\" /
55                        "," / "." /
56                        DQUOTE
57
58    quoted-string   =   [CFWS]
59                        DQUOTE *([FWS] qcontent) [FWS] DQUOTE
60                        [CFWS]
61
62    qcontent        =   qtext / quoted-pair
63
64    qtext           =   %d33 /             ; Printable US-ASCII
65                        %d35-91 /          ;  characters not including
66                        %d93-126 /         ;  "\" or the quote character
67                        obs-qtext
68
69    obs-qtext       =   obs-NO-WS-CTL
70
71    obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
72                        %d11 /             ;  characters that do not
73                        %d12 /             ;  include the carriage
74                        %d14-31 /          ;  return, line feed, and
75                        %d127              ;  white space characters
76
77    quoted-pair     =   ("\" (VCHAR / WSP)) / obs-qp
78
79    VCHAR           =   %x21-7E            ; visible (printing) characters
80
81    obs-qp          =   "\" (%d0 / obs-NO-WS-CTL / LF / CR)
82
83    obs-local-part  =   word *("." word)
84
85    word            =   atom / quoted-string
86
87    atom            =   [CFWS] 1*atext [CFWS]
88
89    domain          =   dot-atom / domain-literal / obs-domain
90
91    domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
92
93    dtext           =   %d33-90 /          ; Printable US-ASCII
94                        %d94-126 /         ;  characters not including
95                        obs-dtext          ;  "[", "]", or "\"
96
97    obs-dtext       =   obs-NO-WS-CTL / quoted-pair
98
99    obs-domain      =   atom *("." atom)
100
101 NB For SMTP mail, the domain-literal is restricted by RFC5321 as follows:
102
103    Mailbox        = Local-part "@" ( Domain / address-literal )
104
105    address-literal  = "[" ( IPv4-address-literal /
106                     IPv6-address-literal /
107                     General-address-literal ) "]"
108
109    IPv4-address-literal  = Snum 3("."  Snum)
110
111    IPv6-address-literal  = "IPv6:" IPv6-addr
112
113    Snum           = 1*3DIGIT
114                   ; representing a decimal integer
115                   ; value in the range 0 through 255
116
117    IPv6-addr      = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
118
119    IPv6-hex       = 1*4HEXDIG
120
121    IPv6-full      = IPv6-hex 7(":" IPv6-hex)
122
123    IPv6-comp      = [IPv6-hex *5(":" IPv6-hex)] "::"
124                   [IPv6-hex *5(":" IPv6-hex)]
125                   ; The "::" represents at least 2 16-bit groups of
126                   ; zeros.  No more than 6 groups in addition to the
127                   ; "::" may be present.
128
129    IPv6v4-full    = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
130
131    IPv6v4-comp    = [IPv6-hex *3(":" IPv6-hex)] "::"
132                   [IPv6-hex *3(":" IPv6-hex) ":"]
133                   IPv4-address-literal
134                   ; The "::" represents at least 2 16-bit groups of
135                   ; zeros.  No more than 4 groups in addition to the
136                   ; "::" and IPv4-address-literal may be present.
137
138 </pre>
139 </body>
140
141 </html>