Re: Replace everything except of...
| From: | Robin Vickery | Date: | Tue, 13 Mar 2001 12:00:00 +0000 |
| Subject: | Re: Replace everything except of... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43648@lists.php.net to get a copy of this message | ||
>>>>> "MT" == Martin Thoma <martin@radiok2r.de> writes:
> Hello ! How can I use eregi_replace to replace every "><BR>" with
> ">", except when it's "<B><BR>" ??
You need a lookbehind assertion...
$string = preg_replace( '/(?<!<b)><br>/i', '>', $string );
-robin
--
Robin Vickery...............................................
Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK
Email: robin@planet-three.net Phone: +44 (0)870 729 5444