Text and keyword search
The application that makes finite automata feel like engineering. Give it some keywords and some text, and watch the head scan — with both machines shown side by side so the cost of guessing is visible.
Hopcroft 2e §2.4.
Try:
The scan
Hover or focus a character to see where the DFA had got to after reading it. Highlighted runs are matches — overlapping ones are all reported.
2 matches: "web" at 0, "ebay" at 1.
The guessing NFA
One chain per keyword, and a start state that loops on everything so a keyword may begin anywhere.
The recognising DFA
One state per keyword prefix. It never guesses, so it reads each character exactly once.