php-db | 2004071

Re: [PHP-DB] Easy reg expression problem From: Justin Patrin (papercrane <email protected>)
Date: 07/15/04

Well, I always use Perl Regexes instead of eregs.

preg_match('/$(.*?)( <email protected>*)^/', $email, $matches);
$beforeAt = $matches[1];
$afterAndIncludingAt = $matches[2];

On Fri, 16 Jul 2004 00:43:46 +0100, ioannes <ioannes <email protected>> 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 protected>";
> 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?
>
> Thanks,
>
> John
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> !DSPAM:40f714ad128177147579472!
>
>

-- 
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