1 b2cfc4e2 2003-09-30 devnull .TH REGEXP9 7
11 b2cfc4e2 2003-09-30 devnull .if t .BR \\$1 \\$2
12 b2cfc4e2 2003-09-30 devnull .if n .RB ` \\$1 '\\$2
16 b2cfc4e2 2003-09-30 devnull .if t .B \\$1
17 b2cfc4e2 2003-09-30 devnull .if n .RB ` \\$1 '
20 b2cfc4e2 2003-09-30 devnull regexp9 \- Plan 9 regular expression notation
21 b2cfc4e2 2003-09-30 devnull .SH DESCRIPTION
22 b2cfc4e2 2003-09-30 devnull This manual page describes the regular expression
23 b2cfc4e2 2003-09-30 devnull syntax used by the Plan 9 regular expression library
24 b2cfc4e2 2003-09-30 devnull .IR regexp9 (3).
25 b2cfc4e2 2003-09-30 devnull It is the form used by
26 b2cfc4e2 2003-09-30 devnull .IR egrep (1)
29 b2cfc4e2 2003-09-30 devnull got complicated.
32 b2cfc4e2 2003-09-30 devnull .I "regular expression"
33 b2cfc4e2 2003-09-30 devnull specifies
34 b2cfc4e2 2003-09-30 devnull a set of strings of characters.
35 b2cfc4e2 2003-09-30 devnull A member of this set of strings is said to be
36 b2cfc4e2 2003-09-30 devnull .I matched
37 b2cfc4e2 2003-09-30 devnull by the regular expression. In many applications
38 b2cfc4e2 2003-09-30 devnull a delimiter character, commonly
40 b2cfc4e2 2003-09-30 devnull bounds a regular expression.
41 b2cfc4e2 2003-09-30 devnull In the following specification for regular expressions
42 b2cfc4e2 2003-09-30 devnull the word `character' means any character (rune) but newline.
44 b2cfc4e2 2003-09-30 devnull The syntax for a regular expression
49 b2cfc4e2 2003-09-30 devnull e3: literal | charclass | '.' | '^' | '$' | '(' e0 ')'
54 b2cfc4e2 2003-09-30 devnull REP: '*' | '+' | '?'
60 b2cfc4e2 2003-09-30 devnull | e0 '|' e1
64 b2cfc4e2 2003-09-30 devnull .B literal
65 b2cfc4e2 2003-09-30 devnull is any non-metacharacter, or a metacharacter
67 b2cfc4e2 2003-09-30 devnull .BR .*+?[]()|\e^$ ),
68 b2cfc4e2 2003-09-30 devnull or the delimiter
69 b2cfc4e2 2003-09-30 devnull preceded by
73 b2cfc4e2 2003-09-30 devnull .B charclass
74 b2cfc4e2 2003-09-30 devnull is a nonempty string
76 b2cfc4e2 2003-09-30 devnull bracketed
77 b2cfc4e2 2003-09-30 devnull .BI [ \|s\| ]
79 b2cfc4e2 2003-09-30 devnull .BI [^ s\| ]\fR);
80 b2cfc4e2 2003-09-30 devnull it matches any character in (or not in)
82 b2cfc4e2 2003-09-30 devnull A negated character class never
83 b2cfc4e2 2003-09-30 devnull matches newline.
84 b2cfc4e2 2003-09-30 devnull A substring
85 b2cfc4e2 2003-09-30 devnull .IB a - b\f1,
90 b2cfc4e2 2003-09-30 devnull in ascending
91 b2cfc4e2 2003-09-30 devnull order, stands for the inclusive
93 b2cfc4e2 2003-09-30 devnull characters between
99 b2cfc4e2 2003-09-30 devnull the metacharacters
102 b2cfc4e2 2003-09-30 devnull an initial
104 b2cfc4e2 2003-09-30 devnull and the regular expression delimiter
105 b2cfc4e2 2003-09-30 devnull must be preceded by a
106 b2cfc4e2 2003-09-30 devnull .LR \e ;
107 b2cfc4e2 2003-09-30 devnull other metacharacters
108 b2cfc4e2 2003-09-30 devnull have no special meaning and
109 b2cfc4e2 2003-09-30 devnull may appear unescaped.
113 b2cfc4e2 2003-09-30 devnull matches any character.
117 b2cfc4e2 2003-09-30 devnull matches the beginning of a line;
119 b2cfc4e2 2003-09-30 devnull matches the end of the line.
123 b2cfc4e2 2003-09-30 devnull operators match zero or more
124 b2cfc4e2 2003-09-30 devnull .RB ( * ),
125 b2cfc4e2 2003-09-30 devnull one or more
126 b2cfc4e2 2003-09-30 devnull .RB ( + ),
127 b2cfc4e2 2003-09-30 devnull zero or one
128 b2cfc4e2 2003-09-30 devnull .RB ( ? ),
129 b2cfc4e2 2003-09-30 devnull instances respectively of the preceding regular expression
130 b2cfc4e2 2003-09-30 devnull .BR e2 .
132 b2cfc4e2 2003-09-30 devnull A concatenated regular expression,
133 b2cfc4e2 2003-09-30 devnull .BR "e1\|e2" ,
134 b2cfc4e2 2003-09-30 devnull matches a match to
136 b2cfc4e2 2003-09-30 devnull followed by a match to
137 b2cfc4e2 2003-09-30 devnull .BR e2 .
139 b2cfc4e2 2003-09-30 devnull An alternative regular expression,
140 b2cfc4e2 2003-09-30 devnull .BR "e0\||\|e1" ,
141 b2cfc4e2 2003-09-30 devnull matches either a match to
143 b2cfc4e2 2003-09-30 devnull or a match to
144 b2cfc4e2 2003-09-30 devnull .BR e1 .
146 b2cfc4e2 2003-09-30 devnull A match to any part of a regular expression
147 b2cfc4e2 2003-09-30 devnull extends as far as possible without preventing
148 b2cfc4e2 2003-09-30 devnull a match to the remainder of the regular expression.
149 b2cfc4e2 2003-09-30 devnull .SH "SEE ALSO"
150 b2cfc4e2 2003-09-30 devnull .IR regexp9 (3)