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 Aahz Maruch other posts by this author
Sep 30 2001 9:59PM messages near this date
Re: scanf style parsing | Re: scanf style parsing
In article <mailman.1001607930.24098.python-list@[...].org> ,
Skip Montanaro  <skip@[...].com>  wrote:
> 
> You'll generally never cook up complex regular rexpressions using
> incremental search because you have no convenient way to correct mistakes
> and retry, but you will use all the pieces and build up more complex stuff
> when you're programming Perl or Python.  Making the leap from Emacs's
> old-style re's to POSIX-style re's as Perl and Python use now is fairly
> straightforward.  Mostly it involves getting rid of backslashes and learning
> about {m,n}, \d, \s and other little shortcuts.  (I still almost never use
> \d.  My fingers just type [0-9] automatically.)
> 
> maybe-the-best-argument-against-vi-ly, yr's

Actually, what I usually do with vi is open up another editor window to
write my regex and then cut'n'paste to the window where I'm doing real
work.  That way I *do* have a convenient way to correct mistakes in
complex regexes.  Here's a cutie:

:s/(\([0-9][0-9][0-9]\)) *\([0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]\)/\1-\2/
-- 
                      --- Aahz  <*>   (Copyright 2001 by aahz@pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

We must not let the evil of a few trample the freedoms of the many.
-- 
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