Let me explain the difference between these two functions of php to evaluate and extract information on strings by using regular expressions or patterns.
Apparently these two functions are apparently equal. The differences between them are minimal, for example preg_match is required to establish some bars that define the pattern, or that this function returns an integer (int) from 0 to n, depending on the matches found, while ereg returns a boolean depending on whether or not matches found.
Where is the difference between preg_match and ereg? Well the main difference as both also return an array with matches by reference, is power of these functions. The function preg_match is very powerful and very useful as ereg, generally tend to use preg_match to extract information from text and the ereg to assess whether a text plays a pattern or not, as is the case of an email [a-zA-Z0-9]{1,}@[a-zA-Z0-9]{1,}\.[a-zA-Z]{2,3}. The problem comes when we perform a relatively complex pattern on a long text, that's when we see the true power difference between preg_match and ereg, as the preg_match could take up to 60 seconds to analyze it (I speak from experience) while the same pattern evaluated with ereg, take about 5 or 6 seconds.
In conclusion we could say that preg_match is an ideal function to analyze and make patterns on relatively small texts, such as the contents of a web page for example, and ereg is to evaluate fast patterns as words or emails and when the pattern to evaluate is very large.
Matias comments that from version 5.3 of PHP launches E_DEPRECATED warning and from version 6 of PHP removed ereg function of PHP function list.