DFA · Regular
Base64 length and padding
Base64 text comes in blocks of four characters, and only the last block may end in padding: one = or two. a stands for any of the 64 characters. The states count the position within the current block and whether padding has begun, after which only = may follow.
The author’s examples, run
ε → acceptaa== → acceptaaaaaa== → acceptaaaaaaa= → accepta → reject=a== → reject=aaaaa== → reject=aaaaaa= → reject