Lines Matching defs:re
253 exit_regerror(int er, regex_t *re)
258 errlen = regerror(er, re, NULL, 0);
261 regerror(er, re, errbuf, errlen);
266 add_sub(size_t n, const char *string, regex_t *re, regmatch_t *pm)
268 if (n > re->re_nsub)
283 add_replace(const char *string, regex_t *re, const char *replace, regmatch_t *pm)
289 add_sub(0, string, re, pm);
300 add_sub(0, string, re, pm);
307 add_sub(*(++p) - '0', string, re, pm);
316 do_subst(const char *string, regex_t *re, const char *replace, regmatch_t *pm)
322 while ((error = regexec(re, string, re->re_nsub+1, pm, flags)) == 0) {
347 add_replace(string, re, replace, pm);
351 exit_regerror(error, re);
356 do_regexp(const char *string, regex_t *re, const char *replace, regmatch_t *pm)
360 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) {
362 add_replace(string, re, replace, pm);
368 exit_regerror(error, re);
373 do_regexpindex(const char *string, regex_t *re, regmatch_t *pm)
377 switch(error = regexec(re, string, re->re_nsub+1, pm, 0)) {
385 exit_regerror(error, re);
466 regex_t re;
476 error = regcomp(&re, mimic_gnu ? twiddle(argv[3]) : argv[3],
479 exit_regerror(error, &re);
481 pmatch = xalloc(sizeof(regmatch_t) * (re.re_nsub+1), NULL);
482 do_subst(argv[2], &re,
485 regfree(&re);
494 regex_t re;
501 error = regcomp(&re, mimic_gnu ? twiddle(argv[3]) : argv[3],
504 exit_regerror(error, &re);
506 pmatch = xalloc(sizeof(regmatch_t) * (re.re_nsub+1), NULL);
508 do_regexpindex(argv[2], &re, pmatch);
510 do_regexp(argv[2], &re, argv[4], pmatch);
512 regfree(&re);