Advertise here: Contact FM.


Regular Expression Ninja
May 14, 2008 4:26 PM   RSS feed for this thread Subscribe

I want to become a regular expression ninja (a black belt). Where should I start?

I'd prefer something interactive (vs. a book or blog post), like a website where I can test them out. I found this site, and it's OK, but are there any others to choose from?
posted by JPowers to computers & internet (7 comments total) 14 users marked this as a favorite
Where should I start?

How about here? There are lots of good links in that thread from Monday.
posted by chrisamiller at 4:29 PM on May 14


Mastering Regular Expressions is the bible, and while practice really counts, so does deep understanding. I used regexps a lot, but it was sort of just switch-pulling until I read that, which took me the step beyond.
posted by bonaldi at 4:36 PM on May 14


RegexBuddy is the absolute best tool I've used for learning and creating regexes. Worth every penny.

Basic regex info can be found on quick google searches (just google your programming languages + regular expressions).
posted by wongcorgi at 4:53 PM on May 14


2nd the book. It truely is the gold standard reference work on RegEx. It will teach you how the RegEx engines work, the different flavors of implementations and then some practical language specific advice.

If you use the jEdit editor, then check out RETest. It is a pretty neat tool to test regular expressions.
posted by mmascolino at 6:44 PM on May 14


Nth-ing _Mastering Regular Expressions_.

If you use Emacs*, there is a really nice interactive regular expression builder mode, Run M-x re-builder with another buffer open (preferably something you want to test searching in) and start adding regexps in the quotes. (Note that you will need to double-quote a few things, e.g. " will be \\" instead of \". (You're inputting a Lisp string, which is a quoted quoted regular expression, eh.) Let's home mefi didn't mangle that...) It will give you immediate feedback, particularly highlighting subexpressions (e.g. \(.*\)), which can be quite helpful.

* While I would highly recommend it in the long term, Emacs is not a thing to take up lightly. Still, if (like me) you make a living editing any kind of formatted text, it will be quite kind to you at the decade level. It has its kinks, though; some for historical reasons, some for "for programmers, by programmers, be damned" cultural reasons.
posted by trouserbat at 8:48 PM on May 14


Regex-coach is good. Scroll down for a screenshot.
(Also seconding trouserbat's Emacs recommendation)
posted by harmfulray at 8:37 AM on May 15


woncorgi's link has a great tutorial.
posted by zouhair at 9:55 AM on May 15


« Older How does one salvage a suitcas...   |   Is there a free full text vers... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
Regex Alms for the Perl-less? December 28, 2007
I'd like to redirect an entire directory to one... March 13, 2007
Python version of this Perl 4-line regexp script? November 11, 2006
Dealing with HTML Parsing Misery? October 26, 2005
(How|Where) does one find Google's (guide|help) on... July 28, 2005