Would be great if there were support for more Regex types. All those supported by grep (ie. BRE, PRE, PCRE) seem fairly essential – and being a Python guy, Python would be nice too (which are PCRE-ish).
If you are looking for a command line regexp builder I highly recommend txt2regex. It is a giant bash script so it runs anywhere bash does and supports:
I'll go ahead and recommend RegexBuddy (http://www.regexbuddy.com/) as another useful tool for testing regexes. (No affiliation, this just happens to be one of the most useful programs I've bought with my own money.)
Don't you hate it when you make a comment through an old HN account and then completely forget about it and post through your normal HN account a quarter of an hour later?
It makes use of a hidden Java applet -- so it supports the somewhat larger Java regex syntax, doesn't send your data anywhere else for matching, and can hook into the string-probing to animate the process. (Click the 'animate?' link to show the animation step/speed controls.)
For example, you can watch the regex that tests whether a number is prime (by failing) or composite (by succeeding) via these two animations:
Is the applet requirement a deal-breaker for casual use? I might be able to feed the OpenJDK 7 regex classes through the Google Java->JS cross-compiler to get a pure-JS solution with the same syntax/animation capabilities.
I don't think its a deal breaker but if its a hidden java applet then why not have the regexes processed on the server as a servlet and sandbox them with a timeout?
That could work, but an original design goal was to avoid server dependencies or bottlenecks.
For instant display or the stepwise animation, the lag of a server roundtrip could be a problem; for some users, posting data to a remote service might introduce privacy concerns. (The regex-powertoy can be run completely locally.)
It's a Windows program, but runs on Linux via WINE. It lets you debug regexes, has live highlighting of matched text, generates regex code in 15+ languages (Perl, Python, Ruby, PHP, C, C#, C++, Delphi, Java, Javascript, MySQL, etc) and is all around awesome.
I'm not affiliated with this program, but it is the BEST regex creation/testing program available anywhere.
It will save you oodles of time if you create (or debug) regular expressions more than 2 times in a year. It's the best software product I've ever bought with my own money.
This regex creator is one I've used for ages; its a bit ugly but it generates the regex for Perl PHP Python Java Javascript ColdFusion C C++ Ruby VB VBScript J#.net C#.net C++.net VB.net.
You type an example (or the actual) string you plan to search over, click submit and it generates a weird chart that you can use to select which bits you want your regex to find. Really advise giving it ago; no regex knowledge required and more importantly.. fast.
I too have a website that does regex testing. It supports Java, JavaScript, .Net, Perl, PHP, Python, Ruby & XRegExp, though some are more complete than others.
Regexs are not hacks. They are part of a programmers toolchest. Just because you write them when you cannot think of a better solution doesn't make them a hack.
They are a legitimate solution for efficient text matching problems.
Nice work, though.