You're right. I remember having disproportionate trouble getting the @ sign 
in the regex and never bothered revisiting the code to add it in. (My 
original code was for internal company use and used force='..regex_here...' 
to ensure the emails were from a set number of internal domains, so it 
wasn't so important)...

On Friday, February 1, 2013 3:21:55 AM UTC, rh wrote:
>
> On Thu, 31 Jan 2013 07:31:22 -0800 (PST) 
> Andrew Buchan <[email protected] <javascript:>> wrote: 
>
> > Lamps, 
> > 
> > I believe using banned is the best way of doing it. You would cover 
> > multiple domains in the regex. 
> > 
> > The following snippet would ensure that addresses ending in gmail.com 
> > or hotmail.com fail registration... 
> > 
> > auth_table.email.requires = [ 
> >   IS_EMAIL(error_message = auth.messages.invalid_email, banned = 
> > '^.*gmail\.com$|^.*hotmail\.com$'),   
> >   IS_NOT_IN_DB(db, auth_table.email) 
> >   ] 
>
> This would also match blogmail.com or redhotmail.com, etc. 
> better to be more specific but I'm not sure what happens to those values. 
>
> That list would get cumbersome if you had to block many domains. 
>
> > 
> > regards, 
> > 
> > Andy. 
> > 
> > 
> > On Thursday, January 31, 2013 12:29:18 PM UTC, Lamps902 wrote: 
> > > 
> > > Hi, web2py users. Is there a preferred method for banning a set of 
> > > email domains from registering? I know that the IS_EMAIL() 
> > > validator has a "banned" parameter, but is this the best way to go 
> > > about this task? If so, is there a way to pass multiple domains to 
> > > the "banned" parameter (I don't think it accepts a list)? Also, is 
> > > this: ('^.*\domain_you_want_to_ban.com(|\..*)$') a reasonable regex 
> > > for this purpose? Thank you. 
> > > 
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> > Groups "web2py-users" group. To unsubscribe from this group and stop 
> > receiving emails from it, send an email to web2py 
> > [email protected] <javascript:>. For 
> > more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
> -- 
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to