On Tue, Jun 3, 2008 at 8:39 PM, VamVan <[EMAIL PROTECTED]> wrote:

> 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


if you know the values are valid email addresses, use a combination of
strripos() and substr().  it will be nice a fast that way.

as an aside, this is what the manual says on preg_match()
Do not use *preg_match()* if you only want to check if one string is
contained in another string. Use
strpos()<http://www.php.net/manual/en/function.strpos.php>or
strstr() <http://www.php.net/manual/en/function.strstr.php> instead as they
will be faster.

and the case insensitive versions are a hair faster still ;)

-nathan

Reply via email to