Re: Re: ereg-replace removing whitespace...

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

 



You're code did the same thing my code did... In other words, it didn't
work... ;)

Again; a string "[/URUB]                    \n\n                \n \t
\n Hello World" should read: "</strong><br />Hello World" after
ereg_replace... And I can't get it to work...

What is the difference between ereg_replace and preg_replace except regular
expression syntax and speed? Does preg_replace allways work without any
extensions in php?


.bobo


----- Original Message ----- 
From: "Justin Patrin" <papercrane@reversefold.com>
To: <php-windows@lists.php.net>
Sent: Tuesday, December 02, 2003 10:20 PM
Subject:  Re: ereg-replace removing whitespace...


> 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
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux