Windows has wonderful tool working with regular expressions - RegexBuddy. It has two problems:
- It's commercial.
- It runs on Windows (Linux version no more available).
What tools (except grep) you use working with regular expressions on Linux?
Windows has wonderful tool working with regular expressions - RegexBuddy. It has two problems:
What tools (except grep) you use working with regular expressions on Linux?
I use Kiki, it's simple but does the job.
Written in Python and there's an ubuntu package named kiki
.
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.
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
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.
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.
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.
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'