Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

I'm in need of a decent tool for building and testing regular expressions, what does everyone use?

I would download expresso but in my last place it turned out to be laden with adware - any clean alternatives?

Links would be much appreciated.

share|improve this question
8  
If you need a special tool to design and test regular expressions, no-one else will have any hope of being able to understand what they do by reading your source code. KISS is extra-important with regular expressions, because the syntax is extra-prone to being cryptic. Have mercy on the people who will need to read and maintain your code. – Steve314 Jun 7 '11 at 10:50
1  
Here is my favorite: derekslager.com/blog/posts/2007/09/… – Joel Etherton Jun 7 '11 at 12:37
rubular.com is my personal favourite. – basicxman Jun 7 '11 at 14:16
@Steve314 - Point taken – billy.bob Jun 7 '11 at 14:21

marked as duplicate by gnat, GlenH7, Martijn Pieters, MichaelT, Robert Harvey Apr 17 at 3:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

11 Answers

Depends what flavour of regex you're using to be honest, for example:

For a .NET regex I normally use LINQPad for testing regexes (it's really good for displaying the output of the Match() function)

I normally use firebug's console to test regexes I intend to use in javascript.

share|improve this answer

I tend to use Regex Buddy to test regular expressions. It isn't very expensive at $40, and even has a regular expression-to-english translation if you need it.

share|improve this answer

I use Rad Software Regular Expression Designer.

It's free, complete and no adware as far as I know. I like the "Language Element window" : double-click a language element to add it to your Regex.

share|improve this answer

http://regexpal.com/

Quick, easy, all web based with no downloads. This is a great tool if Regex isn't your bread and butter and you only need to write regular expressions every once in a while.

share|improve this answer

I like to use RegExr.

It's simple, and has immediate visual feedback. Also, it has a nice collection of community-submitted regexs.

share|improve this answer

Developing on Linux I use Kiki (available in the Ubuntu Repo's). Apparently it's available for Windows / Linux / Mac OS / BSD / Solaris.

Here's a bit of a blurb about Kiki:

A free environment for regular expression testing it allows you to write regular expressions and test them against a sample text, providing extensive output about the results. It is useful for several purposes:

  • exploring and understanding the structure of match objects (handy for people new to regular expressions).
  • testing regular expressions on sample text before deploying them in code.
share|improve this answer
would you mind explaining more on what it does and what it's good for? "Link-only answers" are not quite welcome at Stack Exchange – gnat Apr 16 at 22:25
I updated the answer as requested, sorry for the "Link only" Faux Pas – edwardsmatt Apr 17 at 4:24

Use this one for .NET: Pretty much the best regex tester I've encountered, yet.

Credit goes to herbivore of the mycsharp.de forums. Here's the link to the original thread: http://www.mycsharp.de/wbb2/thread.php?threadid=21580

share|improve this answer

Once I found Regex Coach, I never looked back. It has everything you would expect in a Regex Tool with one feature I haven't seen anywhere else. It allows you to step through the match string and watch the matching engine as it moves over the expression. This lets you see exactly what point of the string is causing it not to be matched. This is great for when you have a working expression, but then find out it is not matching something it should match.

share|improve this answer

I find it very useful to create unit tests for my regular expressions. Usually I'll have two tests: one with expected successes and one with expected failures. It's easy to make a slight "improvement" to a regular expression that subtly changes what it will match. The unit tests also document your intentions (for others and yourself in the future).

share|improve this answer

I use http://www.cuneytyilmaz.com/prog/jrx/ (online - limited to javascript) to test regex expressions, but that doesn't help you build them. And I thoroughly agree with Steve314's comment, you might be able to find a tool to help build it, but your successor won't have a tool to understand it.

share|improve this answer

I'm with Joel's comment - as far as .NET goes, I've always loved Derek Slager's Online Regex Tester, no need to install anything.

If it's a fairly simple regex, I'll often use Notepad++ to test it (though Notepad++'s regex is fairly limited).

Beyond that, using LINQPad as @Ed mentioned is a great idea.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.