Visualize your regular expressions graphically: regexper.com

Visualize your regular expressions graphically: regexper.com

Regular expressions in any programming language are very useful and powerful, saving us from writing many lines of code. If the expression is simple, it will be easy for us as humans to understand it at a glance, but if the expression gets complicated, if we didn’t create it ourselves, or if some time has passed since we did, it can be a bit more difficult to understand what it does or what it’s for.

A few days ago I discovered on Twitter, through a retweet of a user worth following @patxangas, the tool www.regexper.com which generates a graph from a regular expression like the one you see in the image accompanying this post. The example used is:

/(ftp|http|https):\/\/(\w :{0,1}\w*@)?(\S )(:[0-9] )?(\/|\/([\w#!:.? =&%@!\-\/]))?/

As you can see in the image, it is very easy to understand what this regular expression does. Now you can try your own!