Many files are structured i nuch a way that they can be parsed using a finite state machine. Such files comply to a grammar that describes a regular language.
The input considered is of a form such as data.txt
and input.txt
,
while bad_data.txt
is a counter example since it contains nested blocks.
A number of implementations varying from simple to more complex.