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


Notes:

This slide demonstrates repeating a previous expression one or times.

The expression in the first example states: the first character is a space, the second is a p; the third is a lowercase vowel which can occur at least once; followed by a p; then the two periods want to match any printable character; and finally match a space character. The word paper satisfies the match on line 19; and people satisfies the match for line 20 and 22.

The second example attempts to find a space; then the g character; followed by a non-lowercase vowel; and finally a space. There were no lines in the fortunes file to satisfy this expression!

In the third example, the + special character is used. The subexpression [aeiou]+ indicates a lowercase vowel must occur one or more times. This is why the word good on line 21 of the fortunes file satisfies the match.