Agenda

PikeVM

NFA

Algorithm

Trace

Looking for a match anywhere

We cannot just run the engine at every input position: this will ruin our complexity

  1. Lazy dot star, if we fail to find matches we will advance the input by one and try r again

  2. Simulate it ourselves

Regex prefix

Traced PikeVM+

In practice

Proof

Hopefully by now you have the intuition that this algorithm is correct. But how to approach the proof?

Backtracking trees

PikeTree

Meta engine

To guide optimizations, I will analyze the corpus of regexes used in the wild