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

Posted by Richard Heyes on 11/15/05 18:24

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.
>
> Does that regex make about the best sense?

Try this, (# is the regex delimiter):

#^([\w.+-]+)@(([\da-z-]+\.)+[\da-z]{2,4})$#i

--
Richard Heyes
http://www.phpguru.org

 

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

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