Re: preg_match vs ereg etc
| From: | CC Zona | Date: | Mon, 18 Feb 2002 19:17:48 +0000 |
| Subject: | Re: preg_match vs ereg etc | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85257@lists.php.net to get a copy of this message | ||
In article <20020218130457.72986.qmail@pb1.pair.com>,
annazaraah@yahoo.com (Digitalkoala) wrote:
> I was just wondering what your opinions were on using preg_match, preg_split
> instead of ereg and explode?
>
> I have to write a script to parse a lot of html and text files.. and I'm
> looking to use the fastest possible functions to do this...
preg_match() vs. ereg(): preg_* functions are supposed to be siginficantly
faster than their ereg_* "equivalents", so preg_match() should be the
winner here.
preg_split() vs. explode(): these aren't "equivalent" functions. The
former splits on a regular expression; the latter splits on a string value.
--
CC