Regular Expression Ninja
May 14, 2008 4:26 PM   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 answers 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, 2008

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, 2008

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, 2008

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, 2008

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, 2008

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, 2008

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

« Older Don't piss just because you're pissed off.   |   Is this old Norman Mailer article online anywhere? Newer »
This thread is closed to new comments.