Library

DFA · Regular

A number in scientific notation

An optional sign, digits, an optional fraction, an optional exponent with its own sign: d stands for any digit. Every optional part is a fork in the DFA that rejoins the main path.

startsignintdotefracesignexp+, -ddd.edde+, -ddd
The machine as drawn — 8 states, 15 transitions.Every word up to length 3, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

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