Lec9 Regular Expressions.ppt

Chapter 9
Regular
Expressions
©Brooks/Cole,
2001
Figure 9-1
Regular Expression
©Brooks/Cole,
2001
Figure 9-2
Atoms
©Brooks/Cole,
2001
Figure 9-3
Single-Character Pattern Example
©Brooks/Cole,
2001
Figure 9-4
Dot Atom Example
. Matches any character except \n (newline)
©Brooks/Cole,
2001
Figure 9-5
Class Atom Example
A class of letters inside [], [a-z] , [abc], [A-Z0-9]
©Brooks/Cole,
2001
Figure 9-6
Example of Classes
©Brooks/Cole,
2001
Figure 9-7
Anchors
©Brooks/Cole,
2001
Figure 9-8
Operators
©Brooks/Cole,
2001
Figure 9-9
Example of Sequence Operator
©Brooks/Cole,
2001
Figure 9-10
Evaluation of a String
Using Sequence Operator
©Brooks/Cole,
2001
Figure 9-11
Alternation Operator
©Brooks/Cole,
2001
Figure 9-12
Matching Alternation Operators
©Brooks/Cole,
2001
Figure 9-13
Repetition Operator
©Brooks/Cole,
2001
Figure 9-14
Basic Repetition Forms
©Brooks/Cole,
2001
Figure 9-15
Example of Short Form
Repetition Operators
©Brooks/Cole,
2001
Figure 9-16
Repeating Pattern Matching
©Brooks/Cole,
2001
Figure 9-17
Greedy Matching
©Brooks/Cole,
2001
Figure 9-18
Group Operator
©Brooks/Cole,
2001
Figure 9-19
Saving
©Brooks/Cole,
2001