You can use this:
$str = '[EMAIL PROTECTED]';
preg_match('/[EMAIL PROTECTED]@(.+)/', $str, $matches);
var_dump($matches); //will be in $matches[1]
Or without regex:
echo substr($str, strpos($str, '@')+1);
Liran
----- Original Message -----
From: "VamVan" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Wednesday, June 04, 2008 3:39 AM
Subject: [PHP] Regex in PHP
Hello All,
For example I have these email addressess -
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
What would be my PHP function[Regular expression[ to that can give me some
thing like
yahoo.com
hotmail.com
gmail.com
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php