Theory of Computing
THE HYPERTEXTBOOK
Chapter 2. Finite State Automata, Regular Languages, Regular Expressions, and Regular Grammars
Section 2. Finite State Automata

Example

This finite state automaton recognizes the set of all numbers in some programming language.  Numbers, in this case, can be integers, decimal numbers with a single decimal point, and floating point numbers that have an exponent. Study this FSA and try some strings to see what kinds of strings count as numbers and which do not.  For example, can a number that contains a decimal point have no digits before or after the decimal point?  Does the exponent require a sign?