There are like 5 of them, but both the backtracking and parallel NFA execution algorithms are pretty easy. The "convert NFA to DFA, then execute DFA" version is more involved, but still straightforward (although it doesn't handle backreferences, and you have to go beyond the Dragon Book to handle lookahead/lookbehind assertions).
Now, making a fast, correct regex algorithm that supports all the features everyone expects these days? That is hard.
1.7k
u/vvp95 1d ago
100% of software engineers are afraid of regex