Re: ereg-replace removing whitespace...

From: Date: Tue, 02 Dec 2003 21:20:14 +0000
Subject: Re: ereg-replace removing whitespace...
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-22275@lists.php.net to get a copy of this message
I don't use ereg myself, but with preg_replace you could do: $str = preg_replace('/\[\/URUB\]\s*/', '</strong><br />', $str); Bobo Wieland wrote:
Hi... I'm trying to use ereg_replace to replace "[/URUB]" with "</strong><br />" The problem is that ther might, and might not, be any number of trailing whitespaces after the [/URUB]-tag... Everything between the [/URUB] (and the tag itself) and the next alphanumeric char should be replaced with "<strong><br />" So far I use: $str = ereg_replace("(\[/URUB\])+( |\n|\t|\r)*","</strong><br />",$str); which doesn't work, leaving a lot of whitespaces behind... Thanks for your help... .bobo


« previous php.windows (#22275) next »