You are here: Re: [PHP] Validating Email addrs « PHP « IT news, forums, messages
Re: [PHP] Validating Email addrs

Posted by Curt Zirzow on 11/16/05 06:03

On Tue, Nov 15, 2005 at 11:16:15AM -0500, Leonard Burton wrote:
> Hi All,
>
> I know that it is pretty darn impossible to come up with a regular
> expression for validating emails.
>
> How do you all validated emails on form submission?
>
> Is it good just to do something like "/.+@.+[.].+/" ? That (or a
> close derivative) should match that there is at least a @ and a . with
> chars before and after each. I will be sending an email to each new
> registration with a confirmation link.

Since you will be validating emails via a confirmation link, i'd
probably suggest using the minimal testing, I dont think it is
worth the headache. If you become to strict on your regex you
might eliminate something that is valid but the regex thought was
invalid.

At minimum a@a.ab so to modify the regex a bit:

/^.+@.+\..{2,}$/

Curt
--

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация