note 9189 deleted from split by ronabop
| From: | ronabop@php.net | Date: | Wed, 29 Nov 2000 05:57:39 +0000 |
| Subject: | note 9189 deleted from split by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8249@lists.php.net to get a copy of this message | ||
In geneneral, the code:
$var1 =
ereg_replace("b[^e]+e","#","abcdefgabcdefg");
is more efficiant in anyway than a .+ expression.
(If I recall correctly, this is because .+e has to read backwards to evaluate every character. i.e.
for abcdef, it has to read b to know if a is matches.. do this on a 1000 word document, and you can
already start to see the impact. The code [^e] simply sees if the character is e or not.)