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


Notes:

In the first example demonstrates matching a subexpression exactly a certain amount of times. The expression defined is as follows:

As a result lines 18, 21, 22, 23, 25, 28, 29, 30, and 31 satisfies matching this regular expression. The matches are underlined!

In the first part of the second example, the expression wants to:

Notice that line 23 satisfies this match. In the second part, the apostrophe was eliminated from the single character negation list (which means not to match a lowercase vowel). This is why line 24 now satisfies the match since the word isn’t satisfies the definition.

In the final example, the first expression says to match a space; then a capital X; a single character that can be an uppercase U, N, or I; followed by any

This expression failed! However, when we modify the subexpression for the U, N, or I to occur at least once, not to exceed three times ([UNI]\{1,3\}); line 35 satisfied the match. A better expression would have been ___________.