RE: [PHP] Re: Removing every thing between ( )
| From: | Brian Paulson | Date: | Wed, 20 Feb 2002 23:00:12 +0000 |
| Subject: | RE: [PHP] Re: Removing every thing between ( ) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85608@lists.php.net to get a copy of this message | ||
Great,
Thanks for the help, worked like a charm
Brian
-----Original Message-----
From: CC Zona [mailto:email@cczona.com]
Sent: Wednesday, February 20, 2002 1:50 PM
To: php-general@lists.php.net
Subject: [PHP] Re: Removing every thing between ( )
In article <001901c1ba5d$634e3840$89010a0a@bpaulson>,
webmaster@chieftain.com (Brian Paulson) wrote:
> What would the regular expression be to remove all the text
between
> ( )
>
> $string = "This is a (001 Test) and (002 Test)";
$string=preg_replace("/\(.+\)/U",'',$string);
Note that leading/trailing spaces are left in, and the parens are
dropped,
so you may want to adjust it a bit.
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php