Re: REGEX query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>>> > 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@xxxxxxxxx



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux