On Sat, 20 Mar 2004 16:38:54 +0100, "pomho" <po***@nospam.org> wrote:
Even having read the PHP Manual, I can't understand the difference between
the ereg function and the preg_match...
ereg uses POSIX extended regular expressions - these are defined by a standard
Unix specification, but have some limitations in what they can do.
preg_match uses PCRE (Perl Compatible Regular Expressions), which use the more
powerful and typically faster Perl-style expressions; the basics are the same,
but there's more pattern match expressions available in PCRE which means you
can match more complex expressions that would be awkward or just not possible
with ereg.
Unless you have a good reason otherwise, preg_match is preferred.
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk /
http://www.andyhsoftware.co.uk/space