note 12702 deleted from function.ereg by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 01:24:49 +0000 |
| Subject: | note 12702 deleted from function.ereg by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20141@lists.php.net to get a copy of this message | ||
After performing numerous performance tests between ereg and preg_match, I have found that
preg_match is significantly faster, and it really is not that much more difficult to learn than
ereg. In fact, many ereg expressions can be easily modified to preg_match format by simply adding
"/" to the beginning, "/i" to the end (i if case insensitive, omit if not), and
then adding a backslash before every "/" within the old string.
As I said above, preg_match is much faster than ereg. For example, a page that was performing
significant parsing took approximately .41 seconds with ereg compared to .24 for preg_match (same
basic regular expressions given the above modifications). I don't see any reason to ever use
ereg.