A regular expression visualizer

Sometimes writing software gives you byproducts, and this is one. When implementing Piglet i ran into the issue that I couldn’t use the built in System.Text.Regex classes that I would have liked to use to avoid implementing another regular expression engine. No matter, so I built one of my own. Now when implementing one of those bad boys I figured that the best way of debugging them was to draw the same graphs that you find in the books – for the simple reason that getting an overview of a directed graph by investigating a bunch of references is tricky to say the least!

So, wise from experience I figured that you can’t spend too much time writing a good debugging facility, and it turned out quite nicely. So nice in fact that I decided to share this with the rest of the world.

It’s a simple tool that allows you to input your regular expression and see the deterministic and nondeterministic machines that implements your expression. Useful for understanding regular expressions and finding problems in your expressions.

Deployed on Appharbor, which was a truly pleasant experience indeed, it can be found here . Open sourced, if you feel it can be improved, please do so! The code is on github , as usual. The app itself is a teeny-tiny MVC application, with some javascript written by someone who is notoriously bad at it (me). If you find any issues, please do tell me using the communications channel of your choice.

Hope you find it useful!

Tagged , ,

Leave a Reply

%d bloggers like this: