#8038: email address validator does not accept + in addresses
-------------------------+--------------------------------------------------
   Reporter:  ddrake     |       Owner:  was         
       Type:  defect     |      Status:  needs_review
   Priority:  major      |   Milestone:  sage-4.3.2  
  Component:  notebook   |    Keywords:              
     Author:  Dan Drake  |    Upstream:  N/A         
   Reviewer:             |      Merged:              
Work_issues:             |  
-------------------------+--------------------------------------------------

Comment(by ddrake):

 Replying to [comment:5 mpatel]:
 > With luck, someone will write a freely-licensed, full-strength, and
 Pythonic validator that we can `import`.

 You'd think such a thing would exist. It would also be nice to have a
 corpus of validation tests -- you download a pair of big lists (one list
 of crazy but valid addresses, another of plausible but invalid addresses).
 But anyway.

 Your regexp seems pretty good. I'm a bit confused about
 {{{
 %(unquoted)s+(\.%(unquoted)s+)*
 }}}
 though. Doesn't that simply match one or more "unquoted" characters? The
 first bit matches one or more, then the second bit matches zero or more --
 so altogether that's one or more. Right? I'm not a regexp wizard by any
 means.

 Also, the RFC (3696) says that the local part has a maximum of 64
 characters and the domain part a max of 255 characters, so maybe we could
 toss in something like this:
 {{{
 if re_valid_email.match(email) is None:
     return False
 lengths = map(len, email.split('@'))
 if lengths[0] > 64 or lengths[1] > 255:
     return False
 return True
 }}}
 Thoughts?

 Oh, and thanks for telling me how to doctest notebook stuff.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8038#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to