note 36704 added to ref.regex
| From: | mina86 at tlen dot pl | Date: | Sun, 19 Oct 2003 14:14:59 +0000 |
| Subject: | note 36704 added to ref.regex | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58890@lists.php.net to get a copy of this message | ||
I tested how fast POSIX and Perl regular expresions are, and here are the results:
| POSIX Extended | Perl-Compatible | POSIX - Perl
-----------+-----------------+-----------------+-----------------
match | 0.1296420097 | 0.1006720066 | 0.0289700031
match i | 0.1204010248 | 0.1101620197 | 0.0102390051
replace | 0.1896649599 | 0.1298999786 | 0.0597649813
replace i | 10.6998120546 | 0.1453789473 | 10.5544331074
So, as you can see, preg_* functions are faster then ereg* functions. You can find source code of my
test script here: http://mina86.home.staszic.waw.pl/temp/regexp-speed-test.txt
----
Manual Page -- http://www.php.net/manual/en/ref.regex.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36704
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36704&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36704&report=yes
Search -- http://master.php.net/manage/user-notes.php