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


Notes:

The first example matches a space; followed by the characters C- (which can occur zero or one time); followed by the character string Shell or shell; then completing the expression with a space. The result: lines 14 and 26 satisfies this match with the strings C-Shells and shells respectively from the fortunes file. The matches are underlined in this example.

In the second example, the expression wants to match a space; followed by a p; then a vowel that can occur zero or one time; after the possible vowel match, match another p; followed by any two printable characters; then close the expression out matching a space. Line 19 satisfies this match with the word paper from the fortunes file.