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


Notes:

This slide is the first of many examples that illustrate combining the special characters for a compound regular expression.

The first example, illustrates when we want to first match an uppercase or lowercase character d; immediately followed by the lowercase characters i, s, and k. This expression states to find the word disk; spelled with a lowercase or uppercase character d. Since the are no spaces surrounding this word, harddisk and diskpack could satisfy this match from the fortunes file.

The second expression wants to match the s character starting at the beginning of the line; followed by the lowercase characters t, u, as the second and third characters to follow; and the fourth character is a 0 (zero). The fifth character must be a digit ranging from 2 thru 6. The final character to match is the lowercase character a.