RE: [PHP] str_replace question
| From: | SLanger at spirit21 dot de | Date: | Wed, 10 Sep 2003 12:41:50 +0000 |
| Subject: | RE: [PHP] str_replace question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-162158@lists.php.net to get a copy of this message | ||
> preg_replace('/*\<[a-z]+)[0-9]+(\>)/', '$1$2', $String);
Ok why not simply use reg_replace('/<ques[0-9][0-9]>/', '/<ques>/',
$String);
BTW preg regex are more powerfull since they support some stuff that the
posix standard does not support. As far as I know lookbehinds and
lookbacks and stuff like that. Also the POSIX standard dictates that all
matches must be provided and the longest match is choosen. Preg on the
other hand simply returns the first found match and is therefor faster.
Please correct me if I'm wrong!!
Regards
Stefan Langer