Senthil Kumaran <orsent...@gmail.com> added the comment:

Thinking about the regex pattern again. The example given is not really wrong. 
It does what it claims to match, that is '<u...@example.com>' and 
'u...@example.com' and reject <u...@example.com' kind of string. Nothing is 
said about 'u...@example.com>' kind of string. 

Also, this is not an example of validating an email address or finding an email 
address pattern in text data. A good regex for that purposes would be more 
complex[1][2].

Having said that, if example of conditional regex has been given - the current 
one is sufficient (in which case no change is required) or a simpler one can be 
presented, which may not like matching a email address and thus devoid of any 
expectations of valid patterns.

Also, if we 'really' think that rejecting 'user@example>' is good idea in the 
example documentation, then having '$' in no-pattern of regex is good enough. 
No need to think for regex search cases for the explanation given about.


1: http://www.regular-expressions.info/email.html
2: http://ex-parrot.com/~pdw/Mail-RFC822-Address.html

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11283>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to