I think (and don't quote me on this, and feel free to correct me :) that
preg_replace() is fast being based on perl regular expressions.
ereg_replace() however, follows the POSIX standard for regular
expression matching.
Cheers,
Rob.
On Tue, 2003-09-09 at 17:36, Wouter van Vliet wrote:
> $String = "<ques99>";
> preg_replace('/*\<[a-z]+)[0-9]+(\>)/', '$1$2', $String);
>
> will most likeley do.
>
> Btw, does anybody know why preg_replace is adviced over ereg_replace in the
> manual? .. and if ereg_replace doesn't have any advantages over
> preg_replace, couldn't this function get depricated?
>
> -> -----Oorspronkelijk bericht-----
> -> Van: Al [mailto:[EMAIL PROTECTED]
> -> Verzonden: dinsdag 9 september 2003 23:21
> -> Aan: [EMAIL PROTECTED]
> -> Onderwerp: [PHP] str_replace question
> ->
> ->
> -> I've got a simple expression "<quesxx> where "xx" is a number
> -> from 0 to 99.
> ->
> -> I want to replace it with simply <ques>. That is, I want to remove the
> -> numbers.
> ->
> -> Will "str_replace" do it, or must I use ereg_replace?
> ->
> -> I haven't figured out from reading the php manual on regular expression
> -> how to do this simple thing.
> ->
> -> Thanks....
> ->
> -> --
> -> PHP General Mailing List (http://www.php.net/)
> -> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php