[pmwiki-devel] Email pattern...

Martin Fick mogulguy at yahoo.com
Thu May 31 15:26:27 CDT 2007


--- "Patrick R. Michaud" <pmichaud at pobox.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://searchmarketing.yahoo.com/



More information about the pmwiki-devel mailing list