Page 8      All Pages  All Books
Metacharacter
Matches
.
any character except newline
\n
newline
*
zero or more copies of preceding expression
+
one or more copies of preceding expression
?
zero or one copy of preceeding expression
A
beginning of line
$
end of line
a|b
a or b
(ab)+
one or more copies of ab (grouping)
"a+b"
literal “a+b” (C escapes still work)
[]
character class
Table 2-1: Pattern Matching Primitives
7

Page 8      All Pages  All Books