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