Initial regexp version that doesn't crash, but still needs a few improvements (in rendering).