Lines Matching +defs:string +defs:match
54 #include <string.h>
86 regmatch_t *match;
347 if (lastempty || match[0].rm_so != match[0].rm_eo) {
348 /* Locate start of replaced string. */
349 re_off = match[0].rm_so;
350 /* Copy leading retained string. */
356 /* Move past this match. */
357 if (match[0].rm_so != match[0].rm_eo) {
358 s += match[0].rm_eo;
359 slen -= match[0].rm_eo;
362 if (match[0].rm_so < slen)
363 cspace(&SS, s + match[0].rm_so, 1,
365 s += match[0].rm_so + 1;
366 slen -= match[0].rm_so + 1;
370 /* Copy trailing retained string. */
376 if (match[0].rm_eo == match[0].rm_so)
377 match[0].rm_eo = match[0].rm_so + 1;
378 s += match[0].rm_eo;
379 slen -= match[0].rm_eo;
387 /* Locate start of replaced string. */
388 re_off = match[0].rm_so + (s - ps);
389 /* Copy leading retained string. */
393 /* Copy trailing retained string. */
394 s += match[0].rm_eo;
395 slen -= match[0].rm_eo;
597 regexec_e(regex_t *preg, const char *string, int eflags, int nomatch,
609 match[0].rm_so = 0;
610 match[0].rm_eo = slen;
612 eval = regexec(defpreg, string,
613 nomatch ? 0 : maxnsub + 1, match, eflags | REG_STARTEND);
625 * regsub - perform substitutions after a regexp match
629 regsub(SPACE *sp, char *string, char *src)
658 } else if (match[no].rm_so != -1 && match[no].rm_eo != -1) {
659 len = match[no].rm_eo - match[no].rm_so;
661 memmove(dst, string + match[no].rm_so, len);