Re: ACTION-2130: Summarise the apache email validation

On Wed, 05 Jul 2017 14:27:44 +0200, Steven Pemberton  
<steven.pemberton@cwi.nl> wrote:

> I have the first of these running at
>
>  http://homepages.cwi.nl/~steven/forms/examples/email.xml

Both versions are now in that example, and it passes all the example email  
addresses at

https://en.wikipedia.org/wiki/Email_address#Internationalization_examples

Steven

>
> On Wed, 05 Jul 2017 13:53:09 +0200, Steven Pemberton  
> <steven.pemberton@cwi.nl> wrote:
>
>> 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 12:52:43 UTC