Just a simple haskell regex implementation using regex derivatives