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


Notes:

In examining the final example of special characters, we’ll take a close look at the union of regular expressions to do logical ORing. In this example, we want to look for the words: Love, Life, and Line that appears at the beginning of the line.

We considering our options, and understanding how the logical ORing works, the original approach was defining the expression as ‘^Love |^Life |^Line ‘ and be pleased with the results. In fact, the expression is readable! However, it keeping up with tradition of taking advantage of brevity. This is why we could then take advantage of reducing ‘^Life |^Line ‘ to ‘^Li[fn]e ‘; as the expression now becomes ‘^Love |^Li[fn]e ’.

With enough practice, one can take considerable advantage of UNIX regular expressions.