Mark Krenz wrote:
> On Mon, Oct 12, 2009 at 05:55:25PM GMT, Carl P.
Corliss [rabb...@gmail.com] said the following:
>  
>> Code Search of: "eregi?(_replace)?\( lang:php"
shows ~123,000 results
>> Code Search of:
"preg_(filter|grep|last_error|match_all|match|quote|replace_callback|replace|split)\(
lang:php" shows ~374,000 results
>>
>> Looks like preg_* functions are used more often
than ereg* functions to me...
>>     
>
>   I think everyone should read this as it will
prove my point.
> Especially book #9
>
>   I have a O'Reilly Safari Books Online account and
can search the
> content of many of the latest books, which I
consider something more
> official than just doing a causual Google search,
which can be
> misleading.
>
>   The number 1 selling book on Amazon in the PHP
category is "PHP and
> MySQL Web Development" (4th Edition) from 2008 by
Luke Welling and
> Laura Thomson.
>
>   There is no mention of preg_match and the book
instead shows how to
> use ereg based functions.  In fact, they do mention
PCRE, but downplay
> it by saying that POSIX regexs are easier to use.
>
>
>  I think any intelligent person would see this as a
alarm that the PHP
> world isn't ready for ereg to be dropped or
changed.  You need far more
> time for the information to make its way through
the PHP community.
>
>
> Going further through the list of Amazon's top
selling PHP books we
> have:
>
> 2. The Essential Guide to Dreamweaver CS4 with CSS,
Ajax, and PHP (Essentials)
>
>   Ignore this as it isn't really covering PHP properly.
> 3. Regular Expression Pocket Reference: Regular
Expressions: from 2008
>
>   This states that it covered PCRE expressions for
PHP. So at least
>   that's right.
>
>
> 4. Learning PHP, MySQL, and JavaScript: A
Step-by-Step Guide to Creating
> Dynamic Websites from 2009
>
>   Uses examples written with preg_match
>
> 5. Web Database Applications with PHP and MySQL,
2nd Edition from 2004.
>
>   Mentions PCRE but says that they will use POSIX
expressions instead.
>
> 6. Head First PHP & MySQL from 2008/2009
>
>   Talks about preg_match, mentions that ereg is
removed in PHP 6.
>
> 7. PHP Cookbook from 2006
>
>   Has mixed examples, some using ereg and some
using preg_match
>
> 8. Practical Web      Practical Web 2.0
Applications with PHP
>
>   Not on Safari
>
> ---->  9. Programming PHP by  Kevin Tatroe, Rasmus
Lerdorf and Peter
> MacIntyre in 2006. Which may be considered the
definitive guide to PHP
> since Rasmus is a co-author.
>
>   Uses examples with both ereg and preg_match, BUT
ereg is used first in
> the book and compromises the majority of the
section called "Regular
> Expressions".  So here is an example of emphasis
being placed on ereg
> being the more official functions to use.
>
> 10. Wicked Cool PHP: Real-World Scripts That Solve
Difficult Problems
>
>   Not on Safari
>
> So that's about 4 out of 7 the top selling books on
PHP still strongly
> use ereg.  I didn't find any mention in the books I
read online about
> ereg going away.  Some of them supported PCRE more
than others. But
> obviously there is still a lot of use of the POSIX
functions.
>

In PHP Cookbook, the only use of ereg I found was in
the section where the books was explaining how to
convert from ereg to preg_match. Or an occasional
mention that said you could do it with ereg but
preg_match was better. But, I might have missed
something.

Practical Web 2.0 Applications with PHP, published in
2008, uses PCRE functions.

Wicked Cool PHP, published in 2008, uses the PCRE
functions.

The book PHP & MySQL Web Development For Dummies,
published in 2008, uses only
PCRE funcitons. Doesn't even mention ereg.  PHP &
MySQL for Dummies sells pretty well. Its fourth
edition will be released next month. It uses only
PCRE, does not mention ereg.

So, it appears that around 2007 most authors
recognized that they needed to begin moving readers
to the PCRE functions.

Janet

>
>
>
>   





-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to