Lines Matching refs:pm
259 add_sub(int n, const char *string, regex_t *re, regmatch_t *pm)
265 else if (pm[n].rm_so != -1 &&
266 pm[n].rm_eo != -1) {
267 addchars(string + pm[n].rm_so,
268 pm[n].rm_eo - pm[n].rm_so);
276 add_replace(const char *string, regex_t *re, const char *replace, regmatch_t *pm)
282 add_sub(0, string, re, pm);
293 add_sub(0, string, re, pm);
300 add_sub(*(++p) - '0', string, re, pm);
309 do_subst(const char *string, regex_t *re, const char *replace, regmatch_t *pm)
315 while ((error = regexec(re, string, re->re_nsub+1, pm, flags)) == 0) {
316 if (pm[0].rm_eo != 0) {
317 if (string[pm[0].rm_eo-1] == '\n')
327 if (pm[0].rm_so == pm[0].rm_eo &&
328 string + pm[0].rm_so == last_match) {
338 last_match = string + pm[0].rm_so;
339 addchars(string, pm[0].rm_so);
340 add_replace(string, re, replace, pm);
341 string += pm[0].rm_eo;
349 do_regexp(const char *string, regex_t *re, const char *replace, regmatch_t *pm)
353 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) {
355 add_replace(string, re, replace, pm);
366 do_regexpindex(const char *string, regex_t *re, regmatch_t *pm)
370 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) {
372 pbunsigned(pm[0].rm_so);