The implementation is heavily based on the ideas from ["A Play on Regular Expressions"][play] by Sebastian Fischer, Frank Huch and Thomas Wilke. [play]: http://sebfisch.github.com/haskell-regexp/regexp-play.pdf