University of California, Berkeley: Paul Hilfinger's "Lexical Analysis, Regular Expressions"

Study these slides.