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-tutor
python-tutor
Re: [Tutor] Brain In Vice: Why is this so fun to me?
by Alan Gauld other posts by this author
Apr 19 2006 5:25PM messages near this date
Re: [Tutor] Brain In Vice: Why is this so fun to me? | [Tutor] [Linux] open a file in any home "~" ?
>  I cannot for the life of me figure out a pythonic way (read: using the
>  split() builtin) to scan for instances of these characters in such and 
>  such
>  order and proximity. I know this is what regex is for,

I'm afraid so, it looks like the time has come to import re.

>   I have obtained a copy of "Mastering Regular Expressions"

Good book but probably overkill unless you get really serious

>  I would inquire here first for caveats and tips

Build them up gradually, test them at the > >> prompt or using
the tool that comes with Python. Don;t forget the power of building
a negative of what you want and then searching for the inverse.
Finally remember that match() is usually the wrong function to
use - it only searches at the beginning of the string!

And, of course, I have a topic on regex :-)

Good luck!

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Doug Shawhan
Liam Clarke
Liam Clarke
Alan Gauld

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