Re: Easy reg expression problem
| From: | Justin Patrin | Date: | Fri, 16 Jul 2004 00:05:41 +0000 |
| Subject: | Re: Easy reg expression problem | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35298@lists.php.net to get a copy of this message | ||
On Fri, 16 Jul 2004 08:02:17 +0800, Jason Wong <php-db@gremlins.biz> wrote:
> 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().
>
Of course....I'm just so used to pregs...
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--