Lines Matching defs:re

251 exit_regerror(int er, regex_t *re, const char *source)
256 errlen = regerror(er, re, NULL, 0);
259 regerror(er, re, errbuf, errlen);
282 add_sub(int n, const char *string, regex_t *re, regmatch_t *pm)
284 if (n > (int)re->re_nsub)
299 add_replace(const char *string, regex_t *re, const char *replace, regmatch_t *pm)
305 add_sub(0, string, re, pm);
316 add_sub(0, string, re, pm);
323 add_sub(*(++p) - '0', string, re, pm);
332 do_subst(const char *string, regex_t *re, const char *source,
339 while ((error = regexec(re, string, re->re_nsub+1, pm, flags)) == 0) {
364 add_replace(string, re, replace, pm);
368 exit_regerror(error, re, source);
373 do_regexp(const char *string, regex_t *re, const char *source,
378 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) {
380 add_replace(string, re, replace, pm);
386 exit_regerror(error, re, source);
391 do_regexpindex(const char *string, regex_t *re, const char *source,
396 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) {
404 exit_regerror(error, re, source);
485 regex_t re;
497 error = regcomp(&re, source, mode);
499 exit_regerror(error, &re, source);
501 pmatch = xreallocarray(NULL, re.re_nsub+1, sizeof(regmatch_t),
503 do_subst(argv[2], &re, source,
506 regfree(&re);
515 regex_t re;
531 error = regcomp(&re, source, REG_EXTENDED|REG_NEWLINE);
533 exit_regerror(error, &re, source);
535 pmatch = xreallocarray(NULL, re.re_nsub+1, sizeof(regmatch_t), NULL);
537 do_regexpindex(argv[2], &re, source, pmatch);
539 do_regexp(argv[2], &re, source, argv[4], pmatch);
541 regfree(&re);