lockstep

A regular expression engine that cannot backtrack — so it cannot be made to hang.

source on GitHub

The race

The browser's RegExp

backtracking, killed after 5 seconds

ready

lockstep

every alternative at once

ready

Both engines are given the same pattern and the same string of a’s ending in a character that cannot match. The browser has to try every way of splitting those a’s before it can say no.

The compiled program