Library

ε-NFA · Regular

A decimal number, with ε-moves

An optional sign, digits, a decimal point and more digits — either run of digits may be empty, but not both. The ε-move at the start makes the sign optional and the one at the end lets two routes share an accepting state. d stands for any digit.

q0q1q2q4q3q5ε, +, -d.d.ddε
The machine as drawn — 6 states, 10 transitions.Every word up to length 4, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

d.d → accept-dd. → accept+.d → accept.dd → acceptd → reject. → reject+-d.d → rejectd.d. → reject