$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

Reply via email to