Re: Regular expression
| From: | Andrey Hristov | Date: | Wed, 17 Jul 2002 13:41:27 +0000 |
| Subject: | Re: Regular expression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108076@lists.php.net to get a copy of this message | ||
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" <michal.albrecht@astercity.net>
To: <php-general@lists.php.net>
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 someone@something.org blah blah
>
> should result in:
>
> blah blah blah someone@something.org 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
>
>