This is an excellent article on the traps to beware of when regex'ing
email address formats

http://www.regular-expressions.info/email.html

This may ignite a debate though :)

I favour this variation...
[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-
z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|
info|mobi|name|aero|jobs|museum)\b

C


On Aug 7, 8:25 am, Jonathan Lundell <[email protected]> wrote:
> On Aug 7, 2009, at 12:22 AM, mdipierro wrote:
>
>
>
> > I will take a patch for this.
>
> If nobody else gets to it first, I'll work up a patch over the weekend.
>
>
>
>
>
> > Massimo
>
> > On Aug 7, 1:33 am, Jonathan Lundell <[email protected]> wrote:
> >> On Aug 6, 2009, at 9:32 PM, DenesL wrote:
>
> >>> IS_EMAIL does not follow the RFC specs for valid email addresses
> >>> (seehttp://en.wikipedia.org/wiki/E-mail_address)
>
> >>> even a simple [email protected] fails
>
> >>> it is kinda late to work on the regex now, maybe tomorrow.
>
> >> The RFC is fairly hard to validate. If that's what we really want, I
> >> found this one on the web that looks about right:
>
> >> ^(?!\.)("([^"\r\\]|\\["\r\\])*"|([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?...@[a-
> >> z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$
>
> >> It assumes the case-insensitive flag.
>
> >>http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-
> >> email...
>
> >> Overkill? Or, what the heck?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to