These notes
discuss *finite-state automata*,
their practical uses,
and how to implement them in Java.
Finite-state automata are useful in
many application areas:
compiler design,
natural language understanding,
user interface design,
and programming in general.
Many programming problems are
straightforward when understood as
finite automata,
but harder without that understanding.

These notes also discuss regular expressions
and the Java regular expression package,
`java.util.regex`

.
Regular expressions and finite automata are
alternative ways to describe patterns
and both can do pattern matching with character strings.

To use these notes with maximum benefit, read though them interactively. Think about and answer the question at the bottom of each page. These notes assume that you have the Java Development Kit (JDK) version 5.0 or later.

- Section 1 — Finite-state Automata
- Section 2 — Java Implementation
- Section 3 — Finite-state Transducers
- Section 4 — Scanners
- Section 5 — Scanners with One Character Pushback
- Section 6 — Transition Tables

- Section 7 — Regular Expressions (Part 1)
- Section 8 — Regular Expressions (Part 2)
- Section 9 — Regular Expressions (Part 3)
- Section 10 — Java String Class and Regular Expressions
- Section 11 — Java Pattern and Matcher Classes