9

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?

2
  • 1
    what do you need it to do that grep dosn't? Jul 16, 2009 at 11:58
  • 5
    He's looking for a tool that can help debug regular expressions. Jul 16, 2009 at 12:42

14 Answers 14

8

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

1
6

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.

7
  • 3
    Yup: I give the same advice about software to check spelling. Just say no. Learn it.
    – Telemachus
    Jul 16, 2009 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. Jul 16, 2009 at 13:14
  • 2
    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, 2009 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, 2009 at 15:04
  • 1
    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, 2009 at 19:02
3

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

Here's someone's blog entry about it http://bc.tech.coop/blog/071103.html

2

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.

2
  • 1
    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, 2009 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, 2009 at 11:58
2

RegexBuddy is reported to run perfectly on Wine.

2
  • Mr. Downvote, care to explain? Jul 16, 2009 at 12:52
  • 1
    Yes, but it still commercial.
    – Pawka
    Jul 16, 2009 at 13:55
2

There is also Kodos http://kodos.sourceforge.net/

1

Redet seems to be what you're looking for.

1

Not software but website - Rubular

1

txt2regex comes in handy sometimes.

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

1

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

1

http://www.gnu.org/software/gnulib

http://www.solmetra.lt/scripts/regex/

http://weitz.de/regex-coach/

0

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.

2
  • 1
    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, 2009 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. Jul 17, 2009 at 14:40
0

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.

0

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'

You must log in to answer this question.

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