Re: Removing every thing between ( )

From: Date: Wed, 20 Feb 2002 21:49:32 +0000
Subject: Re: Removing every thing between ( )
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-85606@lists.php.net to get a copy of this message
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

« previous php.general (#85606) next »