Re: Easy reg expression problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 16 Jul 2004 08:02:17 +0800, Jason Wong <php-db@xxxxxxxxxxxx> 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@xxxxxxxxx";
> > 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--

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux