0
..
..
.L reexec matches the null-terminated source string against the compiled regular expression re from a previous call to .LR recomp . If it matches, .L reexec returns a non-zero value. If flags is .L RE_MATCH then the array re->match is filled with character pointers to the substrings of source that correspond to the parenthesized subexpressions of pattern : re->match[i].sp points to the beginning and re->match[i].ep points just beyond the end of substring i . (Subexpression i begins at the i th matched left parenthesis, counting from 1.) Pointers in re->match[0] pick out the substring that corresponds to the entire regular expression. Unused elements of re->match are filled with zeros. Matches involving .LR * , .LR + , and .L ? are extended as far as possible. A maximum of 9 subexpressions will be matched. The structure of elements of re->match is:
typedef struct { char* sp; char* ep; } rematch;
.L ressub places in the sfio (3) stream sp a substitution instance of old to new in source in the context of the last .L reexec performed on re->match . Each instance of .LI \e n , where n is a digit, is replaced by the string delimited by .LI re->match[ n ].sp and .LI re->match[ n ].ep . Each instance of .L & is replaced by the string delimited by re->match[0].sp and re->match[0].ep . If .L RE_ALL is set in flags then all occurrences of old are replaced by new . If .L RE_LOWER .RL [ RE_UPPER ] is set in flags then old is converted to lower [upper] case.
.L reerror, called whenever an error is detected in .L recomp, .L reexec, or .L ressub, writes the string msg on the standard error file and exits. .L reerror may be replaced to perform special error processing.