Re: Verify Email

From: Date: Thu, 21 Dec 2000 06:45:53 +0000
Subject: Re: Verify Email
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-31372@lists.php.net to get a copy of this message
Hey Chris: > Hi, this is my first posting to this list. Here's the one I came up with; > it's my first try, would appreciate any comments: > > eregi("^[a-z0-9]{1}[a-z0-9._-]*@[a-z0-9]{1}[a-z0-9-]*\.[a-z.]{2,}$", $email) * The character at the start and just to the right of the "@" don't necessarily have to be letters or numbers, which "^[a-z0-9]{1}" assumes. * You're missing the possibility of "=" in your user name space. * You only take into account one period in the domain space. * "[a-z.]{2,}$" would validate a period at the end of the address. > This one allows four-letter (or more, actually) TLDs (like .aero). Good catch! Took a look at the ICANN site, the new TLD's are listed below. Looks like the longest one is six characters long, so I'd place an upper limit of 6 on that bound. So, here's my new expression: "^[a-z0-9_.=-]+@([a-z0-9-]+\.)+([a-z]{2,6})$" ANTICPATED TLD's: .aero – Societe Internationale de Telecommunications Aeronautiques SC, (SITA) .biz – JVTeam, LLC .coop – National Cooperative Business Association, (NCBA) .info – Afilias, LLC .museum – Museum Domain Management Association, (MDMA) .name – Global Name Registry, LTD .pro – RegistryPro, LTD <rant> Wow, how progressive! A whole seven new TLD's. WOW! :/ There were 47 applications submitted for well over a hundred TLD's. ICANN charged $50,000 just to _apply_. What a bunch of scam artists! Worse yet, none of Name.Space's TLD's were accepted. </rant> --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

« previous php.general (#31372) next »