|
<<Grammar Name="EMail"
encoding_class="ascii"
reference="src:http://tools.ietf.org/html/rfc2821"
reference="src:http://tools.ietf.org/html/rfc2822"
reference="src:http://tools.ietf.org/html/rfc3696"
reference="src:http://en.wikipedia.org/wiki/E-mail_address"
>>
{
PegBegEnd lpart_, dpart_;
bool check_len64_() {return lpart_.posEnd_ - lpart_.posBeg_ <=64;}
bool check_len_255_(){return dpart_.posEnd_ - dpart_.posBeg_ <=255;}
}
[1] ^^email_address: checked_local_part @'@' checked_domain_part;
[2] checked_local_part: local_part:lpart_
(check_len64_ /FATAL<"at most 64 characters before @">);
[3] checked_domain_part:domain_part:dpart_
(check_len_255_/FATAL<"at most 255 characters after @">);
[4] local_part: @('"' quoted_local_part @'"' / unquoted_local_part);
[5] ^^quoted_local_part: (!["\\] print_char / quoted_pair)+ ;
[6] ^^unquoted_local_part: CFWS? atext+ ('.' atext+)* CFWS? ;
[7] atext: local_part_char / quoted_pair ;
[8] print_char: [-A-Za-z0-9.!#$%&'*+/=?^_`{|}~@,[\] ];
[9] quoted_char: '\\' [A-Za-z0-9.!#$%&'*+-/=?^_`{|}~@,"\\[\]];
[10] ^^domain_part: @(dot_atom / domain_literal);
[11] ^^dot_atom: (label ('.'/FATAL<"at least one dot expected">))+ top_level_domain;
[12] ^^domain_literal: CFWS? '[' (FWS? (dtext/quoted_pair))* FWS? ']' CFWS?;
[13]dtext: [#x1-#x8#xB#xC#xE-#x1F#x7F] / [#x21-#x5A#x5E-#x7E] ;
[14]FWS: ([ \t]* '\r\n')? [ \t]+;
[15]CFWS: (FWS? comment)+/FWS;
[16]^^comment: '(' (FWS? ccontent)* FWS? ')';
[17]ccontent: ctext/quoted_pair/comment;
[18]ctext: [#x1-#x8#xB#xC#xE-#x1F#x7F] / [#x21-#x27#x2A-#x5B#x5D-#x7E];
[19]quoted_pair: '\\' [#x1-#x9#xB#xC#xE-#x7F];
[20] ^^label: !top_level_domain [A-Za-z] (!('-' !domain_char) domain_char)*;
[21] ^^top_level_domain:[a-zA-Z]{2,}![-0-9.];
[22] local_part_char: [-A-Za-z0-9!#$%&'*+/=?^_`{|}~];
[23] domain_char: [A-Za-z0-9-];
<</Grammar>>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.