Something like this.
$your_string = preg_replace('/[\d\w]+@([\w\d]{3,}\.)+([\w]{2,4})/','',
$your_string);

HTH

Best regards,
Andrey Hristov

----- Original Message -----
From: "Michal Albrecht" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 1:08 PM
Subject: [PHP] Regular expression


> Hi,
>
> Could anyone help me with the following:
>
> I have to strip the domain from string only if it is not preceded with @
> which means - when it is not an e-mail address.
>
> Examples:
>
> 1. blah blah blah [EMAIL PROTECTED] blah blah
>
> should result in:
>
> blah blah blah [EMAIL PROTECTED] blah blah
>
> 2. blah blah blah something.org blah blah
>
> should result in:
>
> blah blah blah  blah blah
>
> Thanks a lot,
>
>
> Michal
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

Reply via email to