Regular expression book with problems?
November 16, 2010 9:45 PM   Subscribe

Looking for a book / website to teach regular expressions via problems.

I am attempting to learn regular expressions for use in a python program. I'm a beginner programmer and have trouble learning from simply reading. I need to apply the knowledge relatively soon or not only will I forget it, but I won't really understand it.

I'm working my way through a great python book that has problems for me to solve at the end of each chapter and the stuff I'm learning is really sticking. I'm looking for something similar to learn regular expressions.
posted by bindasj to Computers & Internet (8 answers total) 20 users marked this as a favorite
 
The reAnimator is quite a good explanatory tool.
posted by holloway at 10:29 PM on November 16, 2010


I'm a huge proponent of "learn by use" - when you hit a problem, figure out how to do the regex for it. And always remember the famous words of Jamie Zawinski:

Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems.
posted by devilsbrigade at 12:22 AM on November 17, 2010 [2 favorites]


Best answer: The Kodos Regex tool is a little like reAnimator mentioned by holloway. It has quite a focus on Python (will actually write Python code to make use of the Regex you build through it).

RegExr is also a good 'try it out' tool once you figure out that the text which is originally shown in the panel ("Welcome to RegExr 0.3b, an intuitive tool for learning...") should be replaced with a sample of the text you are planning to search.

By the way I'm with holloway (or Zawinski) on the potential to get yourself burnt using regexes - handle with care !
posted by southof40 at 12:30 AM on November 17, 2010


Yes, regexes are the swiss army knife of programming - handy, but one day you're faced with a lame horse, think to yourself "I know - I'll use that tool for removing stones from horse's hooves!", and you end up with face-full of stinking pus.

I've found strfriend a useful tool to visualise both what's going on, and what's going wrong.
posted by Pinback at 12:57 AM on November 17, 2010


Best answer: Bunch of relevant links and commentary in this old thread.
posted by flabdablet at 6:55 AM on November 17, 2010


I like RegExPal for testing the regexes I've written, created by the co-author of the O'Reilly book Regular Expressions Cookbook. You may find both useful.
posted by geeky at 11:03 AM on November 17, 2010


RegexBuddy is my go to tool for learning as well as testing. It'll even generate code for you in multiple languages.
posted by wongcorgi at 12:54 PM on November 17, 2010


I know you're focused on Python and but Rubular, a Ruby regular expression tester, is something I use almost daily.
posted by madh at 9:14 PM on November 17, 2010


« Older Cooking ideas using formulas, not recipes   |   Should my baby go through a full body scan? Newer »
This thread is closed to new comments.