A Regular Expression Matcher (2007)
I&#x27;m impressed.<p>The code lives up to its goal of being a good example of programming.  As Kernighan says, it shows the value of handling special cases early and of recursion.  (It&#x27;s also a good example of how pointer-arithmetic and nul-terminated strings should be used, but the less said about that, the better).<p>Students are likely to not notice the tail recursion, so converting this to an iterative version is probably a nice exercise.<p>But notice that explaining <i>regexps</i> is a non-goal of this example.  There is an underlying state-machine here (encoded in a combination of the instruction pointer and the `text` variable), but it is not very obvious.  For that, Russ Cox&#x27; articles are the go-to.