Hi Peter, RFC822 describes the syntax of e-mail addresses. You'll find it at http://www.ietf.org/rfc/rfc0822.txt?number=822
Best regards, Erek PKHG schrieb: > Thanks Dave, > Indeed, you allow much more complicated e-mail addresses, e.g. special > characters. > > Is there 'somewhere' an official definition, what e-mail addresses may look > like? > > Peter > > -----Oorspronkelijk bericht----- > Van: DaveG [mailto:[email protected]] > Verzonden: zondag 25 oktober 2009 21:33 > Aan: Peter K.H. Gragert > CC: PmWiki Users > Onderwerp: Re: [pmwiki-users] test email adress > > Checking for a valid email address can get very complex, to accommodate > all scenarios. Here's what I use: > > function bi_IsEmail($e){ > return (bool)preg_match( > > "/^[-_a-z0-9\'+*$^&%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*+@(?:(?![-.])[- > a-z0-9.]+(?<![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD" > ,$e); > } > > > ~ ~ Dave > > Peter K.H. Gragert wrote: >> Hello, >> >> I just started to use pmforms.php, especially the mail part. >> >> >> >> On the site there is an idea to check if an email address contains an >> @-sign. >> >> >> >> I use this one >> >> >> >> function valid_mail($str) >> >> { >> >> return (ereg >> > ('(^[0-9a-zA-Z_-]+(\.[0-9a-zA-Z_-]+)*@([0-9a-zA-Z_\-]{1,}\.)+[0-9a-zA-Z]{2,} > $)', >> $str)); >> >> } >> >> >> >> >> >> Is there an even (much) better one? >> >> >> >> Greets >> >> Peter >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> pmwiki-users mailing list >> [email protected] >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users >> >> >> ------------------------------------------------------------------------ >> >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com >> Version: 9.0.695 / Virus Database: 270.14.31/2458 - Release Date: 10/25/09 > 04:10:00 > > > _______________________________________________ > pmwiki-users mailing list > [email protected] > http://www.pmichaud.com/mailman/listinfo/pmwiki-users -- +-----------------------------------+--------------------------------+ I Erek Laatz I I I Senior Consultant I Tel.: +49.(0)431.3993-556 I I Professionals & Projects I FAX: +49.(0)431.3993-999 I I -- I I I Consist Software Solutions GmbH I I I A Consist World Group Company I Mobile: +49.(0)160.90627851 I I Falklandstr. 1-3, 24159 Kiel I E-Mail: [email protected] I I Postfach 93 28, 24152 Kiel I I +-----------------------------------+--------------------------------+ I HRB Kiel Nr. 3983, UST-ID: DE811697637 I I Geschäftsführer: Dipl.-Kfm. Daniel Ries I I Dipl.-Math. Martin Lochte-Holtgreven I I Ines von Jagemann I +--------------------------------------------------------------------+ I Pushing IT forward! I I Ihr IT-Spezialist für Integrations- und Individuallösungen I I Your IT specialist for integration and tailor-made solutions I +--------------------------------------------------------------------+ Finalist beim "Großen Preis des Mittelstandes" <!-- Nichts auf der Welt ist so mächtig wie eine Idee, deren Zeit gekommen ist! Victor Hugo !> _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
