21

I tried some regex tools like Regulator, Regulazy & RegexBuddy. They don't do what I want and they expect the user to know regular expressions.

I want a tool for dummies. You tell the tool I need a regex for something like "match anything that ends with the word 'yes' and it contains at least one occurrence of the phrase '/test/'" and it creates the regex for you.

So I either enter my request in plain English or semi plain English or the tool has all kinds of ready made selections and I choose between them to create what I want ad hoc.

Is there such a tool which is geared towards non developers? I am not looking for a regex tester.

4
  • This question is quite related: stackoverflow.com/questions/500839/regular-expression-compiler
    – Cerebrus
    Feb 5, 2009 at 6:56
  • 5
    Personally, I find the idea of trying to program without wanting to learn even the most basic syntax of the language you're programming in (and regular expressions are a language) to be an appalling concept. Not knowing something is fine; not wanting to understand something you will work with regularly is horrifying. Jun 5, 2012 at 11:50
  • Regexes are a programming language. I don't think it makes sense to say "I don't know programming, but I want to write regexes." Asking for something to write regexes for you based on English makes as much sense as wanting something to write PHP code for you based on English. Dec 11, 2012 at 17:02
  • 1
    @Andy Regex is an expression type, it's not a programming language. You can't build an app using regex only. What I was asking for is a helping tool. Just like a visual tool to create a SQL query or a report designer or a tool to translate from one language to another. There are people who create websites without knowing html. Whether this is the correct way is a different story. Dec 11, 2012 at 20:48

14 Answers 14

14

I have been a fan of Ultrapico's Expresso application. There is a builder section that helps you (a little) in building fragments of the expression. More importantly it will explain an existing expression (either your own or from the built in expression library) section by section.

It also includes a testing and replacement section to see and test your expressions. Lastly it will generate the expression formatted for either C#, C++, or VB.NET so that you know exactly how to insert the expression into your project.

Best of all it's free. I have been using this tool to help learn how regular expressions actually work, especially the complex ones. Can't say it makes writing expressions idiot proof but it has sure made learning expressions easier for me...

This tool was featured in a MSDN Webcast by Zain Naboulsi, and might be worth a watch. Hope this helps, and good luck with your Regex journey!

1
  • Expresso is awesome. I use it for creating complex expressions in Python. The only thing you need to remember to do in that case is ass ?P<whatever> to your named groups.
    – Soviut
    Feb 5, 2009 at 7:42
9

txt2re seems really good. I entered "This string contains test in it and ends in yes" into the box, clicked on test and yes, and got a regular expression. It doesn't focus on teaching how to build regexes, but it shows you the perl code to parse what you need.

The real power of this tool is its ability to recognize things like dates, URLs, and tags. Whitespace didn't seem to work too well, however, and it doesn't appear to handle any sort of repetition.

1
  • +1 Very cool. It even provides sample code to implement the regex in a variety of languages. Feb 27, 2010 at 12:04
9

Personally I really like Expresso http://www.ultrapico.com/Expresso.htm The interface is quite clean - lets you test out search and replace functionality, has good help, plus it generates the C# expressions for you if you like.

2
  • Hang on... for full disclosure here Jan creates a competiting product called "RegexBuddy" (see his own answer above). I recommended Expresso to a developer collegue just last week who knew nothing about regular expressions and found the builder very useful. While I appeciate you want to promote your own product, marking my answer down is very harsh. You could have just disagreed and pimped your product again. Mar 2, 2010 at 10:43
  • I agree with Paul! Paul's answer is good and fits here, so rating it down is not OK and promoting your commercial product via SO isn't too. BTW, I really like Expresso and use it very often for complex RegEx'. Mar 2, 2010 at 11:31
3

For me, the best tool is RegexBuilder it's open source and writen in C#, so you can customize it as much as you want ;)

Enjoy. ;)

1
  • 2
    -1: as specified by the author, he is "not looking for a regex tester"
    – VonC
    Feb 5, 2009 at 7:26
2

For web-based (one line only): http://txt2re.com/

For offline (Full text file is possible): Expresso

1
  • txt2re.com is down
    – user1642018
    Jun 10, 2020 at 7:11
2

I like my own RegEx Builder best: http://www.linuxintro.org/regex

1

I am not sure such a tool exists, since they usually do the opposite:
Analyze a regexp and translate it in plain English.

The closest solution to your need would be this C# library, allowing you to program regexp in a semi-readable way:

Instead of this:

const string findGamesPattern = 
@"<div\s*class=""game""\s*id=""(?<gameID>\d+)-game""(?<content>.*?)<!--gameStatus\s*=\s*(?<gameState>\d+)-->";

You would have, using ReadableRex:

Pattern findGamesPattern = Pattern.With.Literal(@"<div")
    .WhiteSpace.Repeat.ZeroOrMore

    .Literal(@"class=""game""").WhiteSpace.Repeat.ZeroOrMore.Literal(@"id=""")

    .NamedGroup("gameId", Pattern.With.Digit.Repeat.OneOrMore)

    .Literal(@"-game""")

    .NamedGroup("content", Pattern.With.Anything.Repeat.Lazy.ZeroOrMore)

    .Literal(@"<!--gameStatus")

    .WhiteSpace.Repeat.ZeroOrMore.Literal("=").WhiteSpace.Repeat.ZeroOrMore

    .NamedGroup("gameState", Pattern.With.Digit.Repeat.OneOrMore)

    .Literal("-->");
2
  • Do you really find this readable? Is COBOL more readable than C, or just more verbose? Feb 27, 2010 at 11:24
  • @Jan: err... verbose. It is a poor form of self-documentation.
    – VonC
    Feb 27, 2010 at 12:10
1

I was also using Expresso, and found it quite good. The most important thing for me in these tools is validation and not so much visual aids for building expressions. I only need a tool to kind of remind me things, not design them for me.

Anyway, here's another free one, which I quite like. It's called Rad Software Regular Expression Designer. Hope this helps.

1
  • Yes, I agree. I was just trying to suggest an alternative, even if not directly useful, that I haven't created myself.
    – Slavo
    Mar 2, 2010 at 9:37
1

Try RegExr a flash based tool

0

If you are a mac person, try this widget, althought it's also a tester i find it quite useful as it's really easy to get to it while learning regex online

http://mac.softpedia.com/progDownload/Regex-Widget-Download-28467.html

0

I settled on RegexBuddy. It has a debugger, visualizer and translates the regex into plain English.

0

Well it's still very much a tool in development, but you could try Textpression at http://www.textpression.com Disclosure: I'm the author.

Textpression enables visual regex creation with a drag and drop editor; no regex syntax to learn! At time of writing Textpression is still in Alpha, but let me know what you think!

0

Intuitive Regular Expression Analyser and Composer Class (for PHP, Node/JS and Python), regex composer live example here

RegexAnalyser github repository

ps i am the author

0

As per details in your question, I think Regex Builder Tool is the exact tool you need. For the regex you asked in question, you would give requirements in simple plain english like _Match_anywhere_in_text_ _zero_or_more_of_ ( _any_character_) _then_ _one_or_more_of_ ( _exact_string_ ( test)) _then_ _zero_or_more_of_ ( _any_character_) _then_ _exact_string_ ( yes) _then_ _end_of_line_

This would automatically generate regex .*test+.*yes$ You can also test generated regex right there using input like I did test, results yes & it would show that generated regex is matching the text as per your expectations.

Not the answer you're looking for? Browse other questions tagged or ask your own question.