Library

ε-NFA · Regular

Float regex, compiled

The regex [+-]?d+(.d+)? as an ε-NFA, where d stands for any digit — what a regex engine actually builds. ε-jumps make the sign optional; the fraction needs a digit after the dot.

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

The author’s examples, run

dd → accept+ddd → acceptdd.dd → accept-d.d → acceptd. → reject.dd → reject