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
[EMAIL PROTECTED]


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

Reply via email to