note 17105 deleted from function.ereg by jimw

From: Date: Sat, 15 Dec 2001 22:20:42 +0000
Subject: note 17105 deleted from function.ereg by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22866@lists.php.net to get a copy of this message
Use preg_match instead of ereg. It is *MUCH* faster. I had a script that was taking 20+ seconds to run and when I changed it over to preg_match, it went down to pretty much immediately displaying in my browser.<br> To convert a POSIX style string to a Perl style one (at least in my experience) just add a delimiter to the begining and end. Also, add 's' to the end after the delimiter to tell the parser to treat the entire string as one piece instead of multiple lines. (ie. "foo" is changed to "|foo|s")

« previous php.notes (#22866) next »