15-150: Principles of Functional Programming

Lecture 14: Regular Expressions

Regular expressions--and their underlying finite-state automata--are useful in many different applications, and are central to text processing languages and tools such as emacs and grep.

Regular expression pattern matching has a simple and elegant implementation in SML using continuations (with return type bool).

Key Concepts

Sample Code

Example evaluation of the matcher

Some Notes on Regular Expression Matching

Proof from lecture

Slides from Lecture