3 regcomp, regcomplit, regcompnl, regexec, regsub, rregexec, rregsub, regerror \- regular expression
13 Reprog *regcomp(char *exp)
16 Reprog *regcomplit(char *exp)
19 Reprog *regcompnl(char *exp)
23 int regexec(Reprog *prog, char *string, Resub *match, int msize)
27 void regsub(char *source, char *dest, int dlen, Resub *match, int msize)
31 int rregexec(Reprog *prog, Rune *string, Resub *match, int msize)
35 void rregsub(Rune *source, Rune *dest, int dlen, Resub *match, int msize)
38 void regerror(char *msg)
42 regular expression and returns
43 a pointer to the generated description.
44 The space is allocated by
46 and may be released by
48 Regular expressions are exactly as in
54 except that all characters are treated literally.
60 metacharacter matches all characters, including newlines.
63 matches a null-terminated
65 against the compiled regular expression in
71 and fills in the array
73 with character pointers to the substrings of
75 that correspond to the
76 parenthesized subexpressions of
79 points to the beginning and
89 left parenthesis, counting from 1.)
92 pick out the substring that corresponds to
93 the whole regular expression.
96 are filled with zeros.
102 are extended as far as possible.
103 The number of array elements in
107 The structure of elements of
128 starts matching at that point within
133 the last character matched is the one
134 preceding that point.
139 a substitution instance of
141 in the context of the last
149 is a digit, is replaced by the
153 .BI match[ n ].ep\f1.
156 is replaced by the string delimited by
160 The substitution will always be null terminated and
161 trimmed to fit into dlen bytes.
164 called whenever an error is detected in
168 on the standard error file and exits.
170 can be replaced to perform
171 special error processing.
174 returns rather than exits,
187 instead of strings of
189 With these routines, the
195 array elements should be used.
197 .B /sys/src/libregexp
204 for an illegal expression
212 There is no way to specify or match a NUL character; NULs terminate patterns and strings.
215 first appeared in Plan 9 from Bell Labs. This implementation was written from
216 scratch for 9front (May, 2016).