ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: scanf style parsing
by Ralph Corderoy other posts by this author
Oct 1 2001 10:23AM messages near this date
Re: scanf style parsing | Re: scanf style parsing
Hi,

>  > An easy, sure fire way for any programmer to learn regex concepts
>  > is to read Kernighan and Plauger's _Software Tools_ where, amongst
>  > many other interesting topics, they implement a regex pattern
>  > matcher and preceed to use it in their versions of grep, ed, etc.
>  
>  The problem is that this gives a narrow view of regexes and doesn't
>  show the full power available in complex regex languages in
>  Perl/Python.

But that's part of its appeal.  By just sticking with concatenation,
repetition, and alternation you can see through the regex syntax to the
implementation and the matching engine.  Everything from then on is
either syntax enhancements, e.g. r+ == rr*, or stuff that you can
easily learn because you've a good grounding.

>  Much better is _Mastering Regular Expressions_ by Jeffrey Friedl,
>  though it badly needs freshening.

I've read that and I think it goes too deep too soon and takes too many
pages to do it.  It is also cluttered in having to state all the
exceptions at every turn, e.g. `but not in egrep'.  _Software Tools_
gives sufficient grounding to a programmer in a chapter.

Also, like you say, a large part of _Mastering Regular Expressions_ is
out of date since Python and Perl have moved on.  Given how much hassle
JF said it was to right in the first place I wouldn't expect to see him
queing up to right the 2nd Ed. :-)

Cheers,


Ralph.

-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Bruce Dawson
Skip Montanaro
George Demmy
Hans-Peter Jansen
Quinn Dunkan
Tim Hammerquist
Ralph Corderoy
Toby Dickenson
Duncan Booth
Aahz Maruch
Aahz Maruch
Aahz Maruch
Stefan Schwarzer
Grant Edwards
Fredrik Lundh

Malcolm Tredinnick
Ralph Corderoy
Tim Hammerquist
Stefan Schwarzer
Greg Ewing
Skip Montanaro
Boyd Roberts
Steve Clift
Bruce Dawson
Tim Hammerquist
Tim Hammerquist
Tim Hammerquist
Skip Montanaro
Andrew Dalke
Fredrik Lundh
Oleg Broytmann
Andrei Kulakov
Duncan Booth
Chris Barker
Tim Hammerquist
Skip Montanaro
Jon Nicoll
Oleg Broytmann
Bruce Dawson
Skip Montanaro
Andrei Kulakov
Richard Jones
Skip Montanaro
Andrew Dalke

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved