I get nervous when all the examples and code snippets I find are several year old.
This code snippet: http://www.djangosnippets.org/snippets/74/ works in principal, but relies on a regular expression test that is no longer defined n Django. I changed it to use a regex I use in server-side mail handlers to verify proper RFC formatted FROM lines (part of anti spam system). And its works perfect in testing so far. Will have to expand testing to my custom code (I've only done the admin site so far). I just hope I'm not missing some recent boolean flag added recently I just need to set to True... The code I added is: import re # vem = Verify E-Mail. This regular expression is from http://www.regular-expressions.info/email.html # and is designed to detect anything that meets the RFC-2822 standard. vem = re.compile(r"""(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'* +/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d- \x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a- z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]| [01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a- z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\ [\x01-\x09\x0b\x0c\x0e-\x7f])+)\])""", re.I) and change this line to use "vem": if vem.search(username): I'm trying to load the revised code as a comment on the snippet page, but I had to apply for an account, and they have not sent me my confirmation e-mail.... Rich. -- You received this message because you are subscribed to the Google Groups "Django users" 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/django-users?hl=.

