Library

DFA · Regular

An identifier

A letter or underscore, then letters, digits and underscores: a stands for any letter, 0 for any digit. The first symbol is the only one with a restriction.

startidenta, _a, 0, _
The machine as drawn — 2 states, 5 transitions.Every word up to length 5, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

_ → accept_00__a0 → accept_0aa_ → accept_0_a00a_aaaa__ → accept0 → reject000__a0 → reject00aa_ → reject00_a00a_aaaa__ → reject