List Info

Thread: Re: Email pattern...




Re: Email pattern...
country flaguser name
United States
2007-05-31 15:26:27
--- "Patrick R. Michaud" <pmichaudpobox.com> wrote:
> > Also, you probably don't want multiple s in
your
> > expression, so maybe:
> > 
> >  '/^[^]+[^]+.[^]+$/'
> 
> Actually, you really don't want whitespace in the
> expression either, so:
> 
>     '/^[^\s]+[^\s]+\.[^\s]+$/'
> 
> Still better is to be explicit about what is
> allowed, as opposed to what is forbidden:
> 
>     '/^[-+.\w]+[-+\w]+\.[-+.\w]+$/'

Sure, as long as you are 100% positive about what is
permitted (...which I assume you are.)

I can't tell you how annoying a form that rejects my
email address simply because I have a 4 letter TLD in
it is! ;(   (no, really this happened to me)

-Martin



       
____________________________________________________________
________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarket
ing.yahoo.com/

_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Re: Email pattern...
country flaguser name
United States
2007-05-31 15:30:09
On Thu, May 31, 2007 at 01:26:27PM -0700, Martin Fick
wrote:
> --- "Patrick R. Michaud" <pmichaudpobox.com> wrote:
> > > Also, you probably don't want multiple s in
your
> > > expression, so maybe:
> > > 
> > >  '/^[^]+[^]+.[^]+$/'
> > 
> > Actually, you really don't want whitespace in the
> > expression either, so:
> > 
> >     '/^[^\s]+[^\s]+\.[^\s]+$/'
> > 
> > Still better is to be explicit about what is
> > allowed, as opposed to what is forbidden:
> > 
> >     '/^[-+.\w]+[-+\w]+\.[-+.\w]+$/'
> 
> Sure, as long as you are 100% positive about what is
> permitted (...which I assume you are.)

I'm not 100% positive, but I'm certain that the above
would work for the vast majority of email addresses
that are out there, while still rejecting any that contain
whitespace, lack an '', or lack a dot in the domain name.  

Pm

_______________________________________________
pmwiki-devel mailing list
pmwiki-develpmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )