Common Pattern Matching Operations

pattern1 | pattern2 # OR
pattern1 & pattern2 # AND then
pattern [0:]        # zero or more times
pattern [1:]        # one or more times
pattern [0:1]       # zero or one times (optional)
+ pattern           # test without consuming
AtTheEndP ()        # no more input
AnyOfP (chars)      # any character in set
NoneOfP (chars)     # any character except ...
IsP (text)          # match text exactly
New Models for Processing Text and XML with Python Sam Wilmott
Slide 16 of 51        www.wilmott.ca