Re: REGEX query

From: Date: Wed, 08 Feb 2006 19:09:05 +0000
Subject: Re: REGEX query
Groups: php.general 
Request: Send a blank email to php-general+get-230120@lists.php.net to get a copy of this message
I have this bit of text: (\(EX\) RV-6 ) I want to remove the '\(EX\)' part of it so leaving just: ( RV-6 )
$text = '(\(EX\) RV-6 )'; $str = str_replace('\(EX\)','',$text); As Burhan put it, regex is not always the solution to your problem - in most cases, using regex for this kind of operations will just hog your scripts. -- Kim Christensen kim.christensen@gmail.com Thanks Kim, that'll solve the problem very nicely. As a matter of point though, and as I initially said I ma trying to get to grips with REGEX, so perhaps if someone would be kind enough to explain the format that it needs to be in for REGEX, as I've said, I'm having problems with the escaping of the \ & (, so it's somethign I defintely need to know for future reference. Cheers Alexis

« previous php.general (#230120) next »