Library

DFA · Regular

a, then later b, then later c

abc as a subsequence: the letters must appear in that order, but anything may come between them. A substring search falls back on a mismatch; a subsequence search never has to, since a wrong letter is just skipped. Four states, each a self-loop on everything it is not waiting for.

noneaababcb, caa, cba, bca, b, c
The machine as drawn — 4 states, 12 transitions.Every word up to length 5, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

abc → acceptbbaaccacbc → acceptaabc → acceptabbcaababcaccb → acceptbbc → rejectbbaaccacac → rejectaaac → rejectε → reject