tags:

views:

154

answers:

6

Just checking if anyone knows of a tool for describing programmatically a RegEx type problem, for it to then be translated into a RegEx.

What I mean by this is: can any tool take more human readable code/language and convert it to the fairly impenetrable RegEx expressions?

If not: someone really ought to do this! Would be incredibly useful, I'd have thought. Define a small set of keywords and operators to describe an issue, then have the program convert it to the super-efficient RegEx.

A: 

http://txt2re.com/

Ken
While this tool may be helpful, the UI is horrible.
Jonathan Sampson
Given that I don't know of any other tool in the world that does a similar thing, I'm not entirely sure what that means. Having read no documentation, I could click a couple times and get a working regex and source code to a sample program. Heck, the first program of any kind has a lousy UI compared to later attempts -- but it's kind of meaningless to speak of it as such unless there is (or will be) another. :-)
Ken
This is the sort of thing I mean... but it still isn't particularly intuitive :/
AlexW
+2  A: 

I've grown to appreciate http://www.gskinner.com/RegExr/ over the last month or so. It gives you a live visual representation on your own custom data for what matches your expressions. I spent a couple hours in it yesterday, so I'm thoroughly pleased to suggest it today.

For explanations of what patterns do what, rest your mouse over them for popups. There's even a Desktop Version.

Jonathan Sampson
The community-submitted regular expressions are sometimes cool to puzzle out and sometimes actually just what you wanted. The RFC2822 Email Validation one, for example.
Samir Talwar
+5  A: 

RegexBuddy is probably the most useful regular expressions creator/tester/teacher application you will buy.

It is pretty inexpensive at $40 USD. It also comes with a three-month, unconditional 100% satisfied or money back guarantee.

Nick Presta
+1  A: 

Joshua Flanagan wrote a .net fluent interface for readable regular expressions, and Roy Osherove did some work on LINQ to Regex.

Then of course there's Regulazy. Personally I've found the UI a bit, er, strange, but it goes OK if you're in a pickle.

A similar tool is Regex Buddy. Costs money, but I've seen people use it with great success.

There's also a handful of online regular expression testers. Regex power toy looks nice

Dan F
A: 

Wow, no-one mentioned regexlib.com - does noone use it anymore?

slugster
A: 

RX Toolkit is a part of Komodo IDE from Activestate. Very good for learning regexes, and for testing on a sample piece of text, but very expensive.

http://docs.activestate.com/komodo/4.4/regex.html

pokstad