Re: ACTION-2130: Summarise the apache email validation

So here's a possible approach:

1. We include an ascii email type, a subset of RFC 5321:

   email: atom ("." atom)* "@" sub ("." sub)+

   sub: letdig (ldh* letdig)?
   letdig: a-Z A-Z 0-9
   ldh: letdig | "-"
   atom: atext+atext: ALPHA | DIGIT
         | "!" | "#" | "$" | "%" | "&" | "'" | "*" | "+" | "-" | "/"
         | "=" | "?" | "^" | "_" | "`" | "{" | "|" | "}" | "~"

This drops address literals, quoted strings, and requires at least one "."  
after the @

2. We add an "international" email type:

    iemail: atom ("." atom)* "@" sub ("." sub)+

    sub: letdig (ldh* letdig)? | U-label
    letdig: a-Z A-Z 0-9
    ldh: letdig | "-"
    atom: atext+
    atext: ALPHA | DIGIT
         | "!" | "#" | "$" | "%" | "&" | "'" | "*" | "+" | "-" | "/"
         | "=" | "?" | "^" | "_" | "`" | "{" | "|" | "}" | "~"
         | non-ascii
    U-label: <still have to work out exactly the definition, but a string  
of unicode characters with some restriction>

This also drops address literals, quoted strings, and requires at least  
one "." after the @, but allows non-ascii characters on both sides of the  
@.

Steven

Received on Wednesday, 5 July 2017 11:53:44 UTC