Library

DFA · Regular

A byte in decimal: 0 to 255

One part of an IPv4 address, with no leading zeros. The states are the few prefixes that constrain what follows: a 1 allows two more digits, a 2 depends on the next digit, and 25 allows only 0–5.

startdoneonetwoanylim0123, 4, 5, 6, 7…0, 1, 2, 3, 4…0, 1, 2, 3, 456, 7, 8, 90, 1, 2, 3, 4…0, 1, 2, 3, 4…
The machine as drawn — 6 states, 46 transitions.

The author’s examples, run

0 → accept7 → accept42 → accept199 → accept249 → accept255 → accept256 → reject300 → reject01 → reject1000 → reject