RE: [PHP] eregi filter stopping valid email address, part two

From: Date: Tue, 06 Jan 2004 16:11:14 +0000
Subject: RE: [PHP] eregi filter stopping valid email address, part two
Groups: php.general 
Request: Send a blank email to php-general+get-173860@lists.php.net to get a copy of this message
On 06 January 2004 15:53, Dave G wrote: > PHP Gurus > > A while ago on this list I posted a few questions about an eregi > filter for email addresses entered into a form. With the help > of people > on this list, I settled on the following code which has worked fine in > the months since I started using it. The code is this: > > eregi('^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9-]+.[a-zA-Z.]+$', $email) > > But recently, a person was unable to get their email to pass > this eregi test. The email is valid, as they are able to send email to > me. It has the following format: > > xxxxxxxx@xx1.xx-xxx.ne.jp > > Shouldn't this email pass? I've allowed for hyphens after the @ > mark. Is it that there are two many periods? No. You've only allowed for hyphens in the first element after the @ sign -- this address has them in the 2nd element. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#173860) next »