Tapestry Training -- From The Source

Let me help you get your team up to speed in Tapestry ... fast. Visit howardlewisship.com for details on training, mentoring and support!

Wednesday, September 27, 2006

Very handy Regular Expression Tool: QuickREx

I was puzzling out how to do some text processing in Tapestry and it came down to some regular expressions. Now, I use these all the time, but I'm not hyper literate in them ... I always need to test them out before I feel confident in them. I had been using an Eclipse plugin for this that went payware, so for I while I was firing up IRB (interactive Ruby).

Fortunately, during a quick thinking break, I decided to see if there was a new Eclipse tool for this ... and there is QuickREx.

It does a very good job ... it allows you to write your regular expression, provide it with sample text, and view matches and groups within matches very nicely. You can set options (such as multiline or caseless) and it even can run for all the major different RE implementations out there (JDK, ORO Perl, ORO Awk, and JRegex). It does live evaluation, which really helps when trying to "tweak" the expression, and has a bunch of other well thought out features, such as helping you to paste the final expression into Java code (escaping the backslashes, and such, for you).

The expression editor includes completion; hitting ctrl-space brings up a menu of different regular expression codes to insert, each with a snippet of documentation. Nice.

The plugin also includes a secondary view, the Regular Expression Library. This contains a library of regular expressions, each with example text to match against and a chunk of documentation.

In fact, there's a few more features that are hard to explain out of context, but I suspect will prove quite useful. This is another example of a finely crafted tool created not as a demonstration of someone's Eclipse plugin coding chops, but created to be used.

Easy install via the update manager http://www.bastian-bergerhoff.com/eclipse/features) and it's run flawlessly since.

8 comments:

Anjan said...

hi howard,

I've been using regex coach --- http://weitz.de/regex-coach/ -- a common lisp based multi-platform solution. Like it very much -- developed by a single guy -- free as in beer, regular updates.

Don't know how it compares to other popular tools like regex Buddy, etc

BR,
~A

Anonymous said...

That sounds like a useful plugin.

Probably too much to ask that it include an "analyze" plan similar to something like the oracle sql optimizer? That would be awesome :)

Anjan said...

hi jesse,

if you want such a tool, probably something like RegexBuddy -- http://www.regexbuddy.com/analyze.html might be closer.

BR,
~A

Anonymous said...

http://www.fileformat.info/tool/regex.htm
is a handy online one

Greg Ostravich said...

Thanks!
This is great and I blogged about it.
I also like that you can use it as a Test Driven Development tool by typing in your match string and working backward to get your matching regular expression.

andyhot said...

Nice to know. When on Idea, I use the similar RegexPlugin http://plugins.intellij.net/plugin/?id=19

Anonymous said...

Damned if I haven't already used the plugin at least 3-4 times since installing it a couple days ago. Guess you never know when you'll need them.

Thanks Howard!

Wolf said...

Regular expression is really wonderful to parsing HTML or matching pattern. I use this a lot when i code. Actually when I learn any new langauge, first of all I first try whether it supports regex or not. I feel ezee when I found that.

http://icfun.blogspot.com/2008/04/ruby-regular-expression-handling.html

Here is about ruby regex. This was posted by me when I first learn ruby regex. So it will be helpfull for New coders.