Regex – 7 free test tools

Regex – 7 free test tools

Regex – 7 free test tools

Abstract: In this article, we are giving an overview of free tools to create and test Regex expressions. Even if one is skillful in creating Regex expressions, if they are complicated or you do not do it often, it is good to have an available tool to test Regex on different texts and verify they work properly.

Introduction

In this article, we will give a short overview of a selection of freely available tools to test Regex, which are regularly maintained and up to date. We plan to give a short overview of the main characteristics and our impressions. Here is a list of free tools that caught our attention on the internet:

===WebSite tools, free======================

1. Website Regex101 (https://regex101.com/ )

2. Website RegexPal (https://www.regexpal.com/  aka https://www.regextester.com/   )

3. Website RegExr (https://regexr.com/ )

4. Website CyrilEx Regex Tester (https://extendsclass.com/regex-tester.html)

===Windows apps, free=================

5. Regex Hero application (https://regexhero.net /)

6. Expresso application (https://ultrapico.com/expresso.htm)

===Visual Studio-addon, free===========================

7. Visual Studio extension – Regex Editor (https://marketplace.visualstudio.com/items?itemName=GeorgyLosenkov.RegexEditorForVisualStudio2022)

============================

We will shortly test every tool with the same Regex expression and text:

Regex expression: /[-.\w]+@([\w-]+\.)+[\w-]+/g

Test string: “rafa@nadal.com @ hisaa.bb.cc @ novak@djokovic.com”

1)     Website Regex101

(https://regex101.com/)

This is a website tool. Very nice interface and coloring of both expressions and test text. Here is a screenshot of the main form, divided into 2 parts to fit the article:

Left side panel:

Regex101

Right side panel:

Regex101

Please notice the following in the main form:

  • Ability to choose the flavor of Regex (i.e. Javascript, C# etc.) tested
  • You can choose the function (match, substitution etc.) tested
  • Notice up it shows how many steps were performed to analyze the text (in this case 42 steps). That can help to establish how efficient is your Regex
  • It provides a nice “Explanation” in the natural language of Regex expression
  • Shows a list of matches for the test text

Interesting is a Code generator function that can generate code in different languages:

Generated code C#:

Regex101

Generated code Javascript

Regex101

Interesting is “Regex debugger” function, which is available just in PHP version of Regex, that can help analyze the execution of Regex and its complexity and you can execute Regex step-by-step and see where it fails.

Regex101

Altogether, a nice impression of this online tool.

2)     Website RegexPal

(https://www.regexpal.com/ aka https://www.regextester.com/  )

This is a website tool. Here is a screenshot of the main form:

RegexPal

Note the following:

  • Tool is oriented toward Javascript and Perl (PCRE) versions of Regex
  • Nice coloring of Regex expression
  • Matches are not listed separately but highlighted

Generally, gives an impression of a humbler version of the test tool.

3)     Website RegExr

(https://regexr.com/)

This is a website tool. Here is a screenshot of the main form, divided into 2 parts to show different panels:

Panel “List” selected:

RegExr

Panel “Explain” selected:

RegExr

Note the following:

  • Tool is oriented toward Javascript and Perl (PCRE) versions of Regex
  • Nice coloring of Regex expression
  • Matches are listed below, but for info on groups you need to change the panel and select the match in the browser
  • It provides an “Explain” panel that graphically shows an explanation of Regex expression. We find it very interesting and even better than “natural language explanation”. Just, the web form is rigid, and is difficult to see the full expression, you need to scroll and that ruins the fun of it.

We didn’t like the fact that the web form is so rigid and is not possible to move borders and enlarge panels of interest.

4)     Website CyrilEx Regex Tester

(https://extendsclass.com/regex-tester.html)

This is a website tool. Here is a screenshot of the main form:

CyrilEx Regex Tester

Please notice the following in the main form:

  • Ability to choose the flavor of Regex (i.e. Javascript, Java etc.) tested
  • Nice coloring of Regex expression
  • Matches are not listed separately but highlighted. I didn’t see a way to see groups
  • Very nice graph representation of the Regex

We really liked the graph it produced, it was so far the best explanation shown. But other options are a bit humble.

5)     Regex Hero application

(https://regexhero.net/)

This is a standalone Windows application. Here are screenshots:

Main panel:

Regex Hero application

Code generator panel:

Regex Hero application

Panel with “natural language explanation” of the Regex:

Regex Hero application

Benchmark panel:

Regex Hero application

Executed Banchmark:

Regex Hero application

Please notice the following:

  • This is a tool oriented only toward the .NET environment and .NET version of Regex
  • Panels nicely show Regex coloring and highlight Matches
  • Generation of C# and VB code is supported
  • Provides “natural language” explanation of the Regex
  • It is interesting that provides Benchmarking. It works by iterating thru an iterator (collection), so all matches get evaluated. That is equivalent to Javascript Match/g execution when a response array is created. The pity is only it does not show how many “steps” are needed to evaluate Regex, but gives a benchmark in a form of iteration per second, which is a machine/processor dependent mark.

It looks nice and can be useful to .NET developers.

6)     Expresso application

(https://ultrapico.com/expresso.htm)

This is a standalone Windows application. Here are screenshots:

Main panel:

Expresso application

Expressions designer panel:

Expresso application

Code generator panel:

Expresso application

Benchmark panel:

Expresso application

Please notice the following:

  • This is a tool oriented only toward programmers in C++, C#, VB on .NET platform
  • The main window shows matches and groups, as well as an analysis of Regex expression
  • It features an advanced Designer panel for creating Regex expressions
  • Enables code generation for C++, C#, VB
  • It enables testing of the speed of execution of Regex expressions

The application leaves an impression of well thought of and well-rounded application for creating and testing Regex expressions for the need of a .NET developer.

7)     Visual Studio extension – Regex Editor

(https://marketplace.visualstudio.com/items?itemName=GeorgyLosenkov.RegexEditorForVisualStudio2022 )

This is a Visual Studio 2022 extension. Here are screenshots:

Main panel:

Visual Studio extension – Regex Editor

Code generator panel:

Visual Studio extension – Regex Editor

Please notice the following:

  • This is a tool oriented toward the Visual Studio environment and C# and VB
  • Panel nicely shows Regex coloring and highlights Matches and groups
  • Generation of C# and VB code is supported
  • Funny thing, VS2022 was complaining during startup that this extension is slowing startup. VS2022 has slow startup problem always, so maybe it is just blaming any extension you might have for it. Anyway, since I do not use Regex that often, I uninstalled it after tests. Maybe is smarter to use external tool for this.

It looks very tidy, and some will prefer such a tool integrated into Visual Studio.

Conclusion

It is always handy to have around good tools for testing Regex expressions. They are useful for those that create Regex expressions often or complicated ones. They are useful for those that create them once in a while, and whose skills have diminished over time, so they need advanced tools to assist them and refresh their skills.

In our opinion, out of the presented tools, the best impressions were left by

But, of course, everyone will have his own preferences.

No Comments

Sorry, the comment form is closed at this time.