Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / DevOps / testing

Regex - 7 Free Test Tools

5.00/5 (27 votes)
14 Jun 2022MIT6 min read 26.3K  
We are giving an overview of 7 free Regex tools to test and develop Regex expressions
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

Windows Apps, Free

Visual Studio-addon, Free

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 two parts to fit the article:

Left side panel:

Image 1

Right side panel:

Image 2

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 your Regex is.
  • 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#:

Image 3

Generated code JavaScript:

Image 4

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.

Image 5

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:

Image 6

Note the following:

  • Tool is oriented towards 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 two parts to show different panels:

Panel “List” selected:

Image 7

Panel “Explain” selected:

Image 8

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 information 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 it 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:

Image 9

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:

Image 10

Code generator panel:

Image 11

Panel with “natural language explanation” of the Regex:

Image 12

Benchmark panel:

Image 13

Executed Banchmark:

Image 14

Please notice the following:

  • This is a tool oriented only towards the .NET environment and .NET version of Regex.
  • Panels nicely show Regex coloring and highlight Matches.
  • Generation of C# and VB code is supported.
  • It provides “natural language” explanation of the Regex.
  • It is interesting that it provides Benchmarking. It works by iterating through 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:

Image 15

Expressions designer panel:

Image 16

Code generator panel:

Image 17

Benchmark panel:

Image 18

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.
  • It 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:

Image 19

Code generator panel:

Image 20

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 it.

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:

  1. Website Regex101 (https://regex101.com/) and
  1. Expresso application (https://ultrapico.com/expresso.htm)

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

History

  • 13th June, 2022: Initial version

License

This article, along with any associated source code and files, is licensed under The MIT License