Lines Matching +defs:match +defs:string
47 #include <string.h>
78 regmatch_t *match;
359 /* Copy the leading retained string. */
360 if (n <= 1 && (match[0].rm_so > le))
361 cspace(&SS, s, match[0].rm_so - le, APPEND);
364 if (lastempty || (match[0].rm_so - le) ||
365 match[0].rm_so != match[0].rm_eo) {
367 /* Want this match: append replacement. */
372 /* Want a later match: append original. */
373 if (match[0].rm_eo - le)
374 cspace(&SS, s, match[0].rm_eo - le,
380 /* Move past this match. */
381 s = ps + match[0].rm_eo;
382 slen = psl - match[0].rm_eo;
383 le = match[0].rm_eo;
386 * After a zero-length match, advance one byte,
389 if (match[0].rm_so == match[0].rm_eo) {
407 /* Copy the trailing retained string. */
515 regexec_e(regex_t *preg, const char *string, int eflags,
527 match[0].rm_so = start;
528 match[0].rm_eo = stop;
530 eval = regexec(defpreg, string,
531 nomatch ? 0 : maxnsub + 1, match, eflags | REG_STARTEND);
542 * regsub - perform substitutions after a regexp match
546 regsub(SPACE *sp, char *string, char *src)
573 } else if (match[no].rm_so != -1 && match[no].rm_eo != -1) {
574 len = match[no].rm_eo - match[no].rm_so;
576 memmove(dst, string + match[no].rm_so, len);