On 04/08/06, Chris <[EMAIL PROTECTED]> wrote:

Dave M G wrote:
> PHP List,
>
> Recently I wrote a piece of code to scrape data from an HTML page.
>
> Part of that code deleted all the unwanted text from the very top of the
> page, where it says "<!DOCTYPE", all the way down to the first instance
> of a "<ul>" tag.

> Is there any reason why either ereg or preg would be more desirable over
> the other?
>


Ereg uses POSIX regular expressions which only work on textual data and
include locale functionalily. preg uses PCRE, which work on binary as well
as textual data and is a more sophisticated regex engine, incorporating
minimal matching, backreferences, inline options, lookahead/lookbehind
assertions, conditional expressions and so on.

They are often faster than the POSIX equivalents also.




--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk

Reply via email to