Updated the pattern matching code samples.