Lines Matching +defs:match +defs:string
95 #include <string.h>
124 regmatch_t *match;
389 if (lastempty || match[0].rm_so != match[0].rm_eo) {
390 /* Locate start of replaced string. */
391 re_off = match[0].rm_so;
392 /* Copy leading retained string. */
398 /* Move past this match. */
399 if (match[0].rm_so != match[0].rm_eo) {
400 s += match[0].rm_eo;
401 slen -= match[0].rm_eo;
404 if (match[0].rm_so == 0)
406 s, match[0].rm_so + 1, APPEND);
409 s + match[0].rm_so, 1, APPEND);
410 s += match[0].rm_so + 1;
411 slen -= match[0].rm_so + 1;
415 /* Copy trailing retained string. */
421 s += match[0].rm_eo;
422 slen -= match[0].rm_eo;
428 /* Locate start of replaced string. */
429 re_off = match[0].rm_so + (s - ps);
430 /* Copy leading retained string. */
434 /* Copy trailing retained string. */
435 s += match[0].rm_eo;
436 slen -= match[0].rm_eo;
553 regexec_e(regex_t *preg, const char *string, int eflags, int nomatch, size_t slen)
567 if (slen > 0 && string[slen - 1] == '\n')
573 (void)memcpy(buf, string, slen);
576 nomatch ? 0 : maxnsub + 1, match, eflags);
579 match[0].rm_so = 0;
580 match[0].rm_eo = slen;
581 eval = regexec(defpreg, string,
582 nomatch ? 0 : maxnsub + 1, match, eflags | REG_STARTEND);
596 * regsub - perform substitutions after a regexp match
600 regsub(SPACE *sp, char *string, char *src)
627 } else if (match[no].rm_so != -1 && match[no].rm_eo != -1) {
628 len = match[no].rm_eo - match[no].rm_so;
630 memmove(dst, string + match[no].rm_so, len);