Re: Easy reg expression problem

From: Date: Fri, 16 Jul 2004 00:02:17 +0000
Subject: Re: Easy reg expression problem
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-35297@lists.php.net to get a copy of this message
On Friday 16 July 2004 07:43, ioannes wrote: > I am trying to work out how to isolate the bit after and including the @ in > an email address using php. I would be grateful if someone could point me > to the expression. > > $email="me@email.com"; > ereg("([a-zA-Z0-9])@([a-zA-Z0-9]).([a-zA-Z0-9]))", $email, $regs); > print("@".$regs[1].$regs[2].$regs[3]); > > prints @ > > What am I doing/need to do? If you're simply trying to get '@email.com' then use strstr(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db ------------------------------------------ /* To our sweethearts and wives. May they never meet. -- 19th century toast */

« previous php.db (#35297) next »