Re: Removing every thing between ( )

From: Date: Wed, 20 Feb 2002 22:01:42 +0000
Subject: Re: Removing every thing between ( )
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-85609@lists.php.net to get a copy of this message
On Wednesday, February 20, 2002, at 05:24 PM, Brian Paulson wrote:
What would the regular expression be to remove all the text between ( ) $string = "This is a (001 Test) and (002 Test)"; The numbers always change but the word stays the same
preg_replace("/(\()\d{3,3} Test(\))/", "\1\2", $string); That will leave your string looking like "This is a () and ()". Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#85609) next »