Lines Matching +defs:string +defs:match
63 #include <string.h>
96 regmatch_t *match;
413 if (lastempty || match[0].rm_so != match[0].rm_eo) {
414 /* Locate start of replaced string. */
415 re_off = match[0].rm_so;
416 /* Copy leading retained string. */
422 /* Move past this match. */
423 if (match[0].rm_so != match[0].rm_eo) {
424 s += match[0].rm_eo;
425 slen -= match[0].rm_eo;
428 if (match[0].rm_so < slen)
429 cspace(&SS, s + match[0].rm_so, 1,
431 s += match[0].rm_so + 1;
432 slen -= match[0].rm_so + 1;
436 /* Copy trailing retained string. */
442 if (match[0].rm_eo == match[0].rm_so)
443 match[0].rm_eo = match[0].rm_so + 1;
444 s += match[0].rm_eo;
445 slen -= match[0].rm_eo;
453 /* Locate start of replaced string. */
454 re_off = match[0].rm_so + (s - ps);
455 /* Copy leading retained string. */
459 /* Copy trailing retained string. */
460 s += match[0].rm_eo;
461 slen -= match[0].rm_eo;
677 regexec_e(regex_t *preg, const char *string, int eflags, int nomatch,
694 (void)memcpy(buf, string, slen);
697 nomatch ? 0 : maxnsub + 1, match, eflags);
700 match[0].rm_so = 0;
701 match[0].rm_eo = (regoff_t)slen;
702 eval = regexec(defpreg, string,
703 nomatch ? 0 : maxnsub + 1, match, eflags | REG_STARTEND);
716 * regsub - perform substitutions after a regexp match
720 regsub(SPACE *sp, char *string, char *src)
748 } else if (match[no].rm_so != -1 && match[no].rm_eo != -1) {
749 len = (size_t)(match[no].rm_eo - match[no].rm_so);
751 memmove(dst, string + match[no].rm_so, len);