Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

November 2007
Sun Mon Tue Wed Thu Fri Sat
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
Oct  Dec

Regex-tool for Emacs

Saturday, November 3, 2007

I use regular expressions when I need to, but not frequently enough that I can construct complex regex strings without a bit of trial and error. When I used to use Windows (yuck, petuweee ;-) ), I would use Edi Weitz's excellent Regex Coach to help out. However, when I moved over to Mac OS X, that ceased to be an option (Edi doesn't provide a Mac version of his utility). So, for most of my regex stuff, I just used the rexexp-builder function that comes with later versions of Emacs. However, recently John Wiegley announced that he had written regex-tool.el, an Emacs library that provides a similar UI to Edi's tool. I had a play with it and found it really convenient for constructing regular expressions:

Regex Tool

It supports both Emacs-style and Perl-style regular expressions. It isn't anywhere as featureful as Edi's utility; however, it is still quite a useful tool. The whole program is only 181 lines long (including comments and blank lines!). Very nice!

emacs Copyright © 2007 by Bill Clementson