Categories
Development

An Independent Review of RegViz (Regex Online Tester)

Recently I was asked to look at a brand- new online regex tester, regviz.org, developed as a collaboration of VISUS, University of Stuttgart and University of Trier. Though there are a lot of regex online testers on the market today, and many of them are quite good, let’s look at what is special about regviz.org and what it lacks. Features […]

regviz.org logoRecently I was asked to look at a brand- new online regex tester, regviz.org, developed as a collaboration of VISUS, University of Stuttgart and University of Trier. Though there are a lot of regex online testers on the market today, and many of them are quite good, let’s look at what is special about regviz.org and what it lacks.

Features

First of all let’s highlight some features that make this online regex tester so special.

Single-purpose edit controls

Unlike other similar tools, this one doesn’t use text areas or input text fields for entering regular expression and text for testing it. Instead the developers created their own editor that allows adding a special marking to the text. I think this is the most outstanding feature of this tool.

For example, this editor is able to highlight special characters and numbered groups right in the place where you type in your regular expression:

regex marking

When you hover some element of your regex you get a tootlip with an explanation (but so far these explanations are not as rich as they could be):

regex tooltip

In the same manner, the result box also has some specialized marking. You can see which text matches, which text doesn’t match and where the numbered groups are:

result marking

Along with the mentioned advantages, these custom edit boxes have their minor drawbacks as well. For example, when you select text, you may see some strange behavior (at least in Google Chrome on my Mac):

strange selection

Tests

The RegViz tool allows you to specify some portions of the text to use as testing samples for your regular expression.  This allows you to quickly evaluate the successfulness of your regex.

For example, if you are building an email testing regex, you can specify several email addresses as tests and see how your regex succeeds with them:

regvix tests feature

From this picture you can see that my regular expression successfully passed two tests out of three and has one possible additional match.

Sharing

Though many online regex testers allow sharing the regexes and results, this one puts all parameters right into the URL instead of creating a session and giving you a short permalink. For example, here is an example of a URL for a short regular expression and its source text:

http://regviz.org/?state=%7B%22regex%22%3A%22test%22%2C%22modifier%22%3A%22gi%22%2C%22text%22%3A%22online%C2%A0regex%C2%A0tester%5Cn%22%7D

Though this approach gives you the ability to build your own URLs to regviz.org, it has some obvious limitations related to maximum URL length and the necessity of using of link shorteners for sharing on Twitter or somewhere else.

Shortcomings and limitations

Of course this tool is not absolutely perfect, and for the sake of fairness I need to write about some of its shortcomings and limitations.

JavaScript Regexes Only

RegViz works with JavaScrips regexes only. This is a serious limitation. It’s not a secret that different languages have slightly different regex implementations. For example, I constantly work with C#, PHP (pcre) and Python; for this reason I’d like to test regex for these engines as well. That’s why I would prefer regex101.com in this regard.

Not Responsive Enough

Though regviz.org has a nice and simple interface, the layout of its page doesn’t match narrow screens in a proper way. If you try to use it on a mobile device, for example, you will find that the right panel (with a quick help) overlays the main working area. This behavior is not acceptable for a modern online tool.

Doesn’t apply changes immediately

Unlike some other tools of this kind, RegViz has a certain lag-time for applying changes. When you make a change in the regular expression, you have to wait a couple of seconds before your change is applied. I don’t know why the developers decided to do it this way, but this may cause some confusion on the end user side (at least it did for me).

Conclusion

RegViz.org is an online regex tester offering a visual way for marking your regular expression and matching result. Its creators made an attempt to create special regex-focused edit controls to make the life of JavaScript-developers easier. Despite its shortages (all of them are fixable), this tool suggests a quite convenient way of regular expression testing and is definitely worthy of your attention.

One reply on “An Independent Review of RegViz (Regex Online Tester)”

Thanks for the great review!

I’m one of the developers of RegViz and your feedback is very valuable for us. RegViz is still under development and we will try and improve the issues discussed.

As described correctly in the review, in particular, regex editing is still not optimal. We are currently working on that and replacing our first, naive implementation by something more elaborate. It’s actually a non-trivial problem: If somebody is interested in the mechanics of faking text editors with JS, this blog post is very good read:

http://marijnhaverbeke.nl/blog/browser-input-reading.html

BTW, if you want the regex to recompile, just hit enter and don’t wait for the automatic compilation.

We are certainly interested in more feedback and will definitely read every comment posted below.

Thanks,
Fabian

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.