Previous slide Next slide Back to the first slide View text version


Notes:

This example is an interesting one showing a decent dilemma when massive code changes are in order. In this example the scenario is as follows: change all printf() function calls to fprint() function calls while preserving the message to be printed.

The expression for the pattern match looks cryptic, however after you create your algorithm its not that difficult to transcribe the words to an expression. The algorithm for the expression is the following:

Unfortunately the expression to match wasn't specific enough; as we should have been matching for a string indicating it couldn't open the file. The following one command line produces the accurate results:

There may still room for improvement in refining the expression. Think of how one may have multiple statements on a line delimited by semicolons.