Lines Matching refs:pm
280 add_sub(int n, const char *string, regex_t *re, regmatch_t *pm) in add_sub() argument
286 else if (pm[n].rm_so != -1 && in add_sub()
287 pm[n].rm_eo != -1) { in add_sub()
288 addchars(string + pm[n].rm_so, in add_sub()
289 pm[n].rm_eo - pm[n].rm_so); in add_sub()
297 add_replace(const char *string, regex_t *re, const char *replace, regmatch_t *pm) in add_replace() argument
303 add_sub(0, string, re, pm); in add_replace()
314 add_sub(0, string, re, pm); in add_replace()
321 add_sub(*(++p) - '0', string, re, pm); in add_replace()
331 const char *replace, regmatch_t *pm) in do_subst() argument
337 while ((error = regexec(re, string, re->re_nsub+1, pm, flags)) == 0) { in do_subst()
338 if (pm[0].rm_eo != 0) { in do_subst()
339 if (string[pm[0].rm_eo-1] == '\n') in do_subst()
349 if (pm[0].rm_so == pm[0].rm_eo && in do_subst()
350 string + pm[0].rm_so == last_match) { in do_subst()
360 last_match = string + pm[0].rm_so; in do_subst()
361 addchars(string, pm[0].rm_so); in do_subst()
362 add_replace(string, re, replace, pm); in do_subst()
363 string += pm[0].rm_eo; in do_subst()
372 const char *replace, regmatch_t *pm) in do_regexp() argument
376 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) { in do_regexp()
378 add_replace(string, re, replace, pm); in do_regexp()
390 regmatch_t *pm) in do_regexpindex() argument
394 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) { in do_regexpindex()
396 pbunsigned(pm[0].rm_so); in do_regexpindex()