Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Windows has wonderful tool working with regular expressions - RegexBuddy. It has two problems:

  1. It's commercial.
  2. It runs on Windows (Linux version no more available).

What tools (except grep) you use working with regular expressions on Linux?

share|improve this question
what do you need it to do that grep dosn't? – Jeremy French Jul 16 '09 at 11:58
He's looking for a tool that can help debug regular expressions. – ConcernedOfTunbridgeWells Jul 16 '09 at 12:42

14 Answers 14

See my answer to How do you write and test your regular expressions? on StackOverflow.

Don't use Regex Buddy, nor any similar tool.

Spend a bit of time learning how regular expressions work.

They are actually much simpler than people think.

share|improve this answer
Yup: I give the same advice about software to check spelling. Just say no. Learn it. – Telemachus Jul 16 '09 at 12:47
Hmm, I'm less sure about spelling - there's a huge number of words, languages and grammar oddities to confuse people. Regular Expressions are incredibly simple compared to any human/spoken languages. – Peter Boughton Jul 16 '09 at 13:14
Tools like Regex Buddy doesn't write regular expressions for you, so user still needs to learn them. But it helps write them, especially then expressions becomes quite big. – Pawka Jul 16 '09 at 14:04
@ Peter: I grant that spelling may be harder (for some people, some kinds of learners). Still, learn it. Software only gives you a false sense of security anyhow. Software can't spell well at all. – Telemachus Jul 16 '09 at 15:04
Even if you don't need help, it can still be helpful. I know regular expressions quite well but I still like to use a graphical editor when I have one available. – David Z Jul 16 '09 at 19:02

I use Kiki, it's simple but does the job.

Written in Python and there's an ubuntu package named kiki.

enter image description here

share|improve this answer

I usually use emacs with regex-tool. It get's the job done.

Here's someone's blog entry about it

share|improve this answer

MonoDevelop includes a powerfull Regex tool. It includes a library of user submitted Regexes and a Regex tester.

The regex validator is System.Text.RegularExpressions.Regex.

share|improve this answer
+1 since I reached my voting limit. – BinaryMisfit Jul 16 '09 at 11:43
I've just tried - it's nice. But I will not run another IDE only for regexps while I'm not developing Mono. – Pawka Jul 16 '09 at 11:51
TRue. Lucky me I'm a C# developer... oh wait... you can do other languages, not related to dotNet at all in MonoDevelop. C and C++ are quite well supported. More to come. (Ruby, Delphi, etc). – Dykam Jul 16 '09 at 11:58

RegexBuddy is reported to run perfectly on Wine.

share|improve this answer
Mr. Downvote, care to explain? – Robert Munteanu Jul 16 '09 at 12:52
Yes, but it still commercial. – Pawka Jul 16 '09 at 13:55

There is also Kodos

share|improve this answer

Redet seems to be what you're looking for.

share|improve this answer

Not software but website - Rubular

share|improve this answer

txt2regex comes in handy sometimes.

By the way, for Windows, I like Regex Coach.

share|improve this answer

There's an add-on for Firefox that I find handy for my not-to-onerous needs.

share|improve this answer

Vim. Dynamically finds and highlights the first match for the regular expression as you type it.

I use this on Windows too, actually, for the same reason.

share|improve this answer
You might find that vim's regexs are not entirely standard. In particular I'm thinking of + which you have to backslash to work as a "one or more" matcher, where in, err, regular regular expressions the backslash would escape it. – Evan Jul 17 '09 at 3:58
Evan's point is correct. The Q doesn't specify what the intended purpose of the regular expression is. I find that it's very easy to take a regex that works for me in Vim and apply it in other situations. There seem to always be variations in escaping and other syntax details between regex implementations anyway. – Zac Thompson Jul 17 '09 at 14:40

I usually don't use any tools for this, but kregexpeditor seems to be worth mentioning. It has all the features you'd expect and the next version will even support backreferences.

share|improve this answer

The only good regexp is a lex / yacc regexp. Spend some time learning lex/flex and yacc/bison, or some similar parser toolkit. I'm convinced this is the way to go if you want to do some good work with regexps!

If you insist on using 'normal' ugly regexps, you could do worse than perl for testing them:

perl -pe 's/fo+o/bar/'
perl -ne 'print $1 if /(hell*o|world)/i/'
</etc/passwd perl -ne 'print if /bash|tcsh/'

You can also try GNU grep with color, and extended regexps:

</etc/passwd grep --color -E 'bash|tcsh'
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .