| /openbsd/src/usr.bin/lex/ |
| D | regex.c | 87 if (m == NULL || m->rm_so < 0) in regmatch_dup() 89 len = m->rm_eo - m->rm_so; in regmatch_dup() 93 strncpy (str, src + m->rm_so, len); in regmatch_dup() 106 if (m == NULL || m->rm_so < 0) { in regmatch_cpy() 112 snprintf (dest, regmatch_len(m), "%s", src + m->rm_so); in regmatch_cpy() 123 if (m == NULL || m->rm_so < 0) { in regmatch_len() 127 return m->rm_eo - m->rm_so; in regmatch_len() 148 if (m == NULL || m->rm_so < 0) in regmatch_strtol() 171 return (m == NULL || m->rm_so < 0 || m->rm_so == m->rm_eo); in regmatch_empty()
|
| /openbsd/src/regress/lib/libc/regex/ |
| D | main.c | 94 subs[0].rm_so = startoff; in main() 105 len = (size_t)(subs[0].rm_eo - subs[0].rm_so); in main() 106 if (subs[0].rm_so != -1) { in main() 109 argv[optind] + subs[0].rm_so); in main() 112 argv[optind] + subs[0].rm_so); in main() 115 if (subs[i].rm_so != -1) in main() 117 (int)(subs[i].rm_eo - subs[i].rm_so), in main() 118 argv[optind] + subs[i].rm_so); in main() 258 subs[0].rm_so = strchr(f2, '(') - f2 + 1; 261 f2copy[subs[0].rm_so - 1] = subs[0].rm_so > 1 ? [all …]
|
| /openbsd/src/usr.bin/mg/ |
| D | re_search.c | 159 plen = regex_match[0].rm_eo - regex_match[0].rm_so; in re_queryrepl() 166 plen = regex_match[0].rm_eo - regex_match[0].rm_so; in re_queryrepl() 180 plen = regex_match[0].rm_eo - regex_match[0].rm_so; in re_queryrepl() 224 plen = regex_match[0].rm_eo - regex_match[0].rm_so; in re_repl() 297 k = regex_match[num].rm_eo - regex_match[num].rm_so; in re_doreplace() 300 bcopy(&(clp->l_text[regex_match[num].rm_so]), in re_doreplace() 361 regex_match[0].rm_so = tbo; in re_forwsrch() 411 regex_match[0].rm_so = 0; in re_backsrch() 413 lastmatch.rm_so = -1; in re_backsrch() 422 regex_match[0].rm_so <= tbo) { in re_backsrch() [all …]
|
| /openbsd/src/bin/ed/ |
| D | sub.c | 199 rm[0].rm_so++; in substitute_matching_text() 205 i = rm[0].rm_so - (eom - txt); in substitute_matching_text() 219 if (rm[0].rm_so == rm[0].rm_eo) in substitute_matching_text() 220 rm[0].rm_so = rm[0].rm_eo + 1; in substitute_matching_text() 222 nempty = rm[0].rm_so = rm[0].rm_eo; in substitute_matching_text() 224 } while (rm[0].rm_so < lp->len && (gflag & GSG || kth) && in substitute_matching_text() 249 j = rm[0].rm_so; in apply_subst_template() 256 j = rm[n].rm_so; in apply_subst_template()
|
| /openbsd/src/usr.bin/sort/ |
| D | sort.c | 497 if (pmatch[0].rm_eo <= pmatch[0].rm_so) in parse_pos() 500 if (pmatch[1].rm_eo <= pmatch[1].rm_so) in parse_pos() 503 len = pmatch[1].rm_eo - pmatch[1].rm_so; in parse_pos() 506 memcpy(f, s + pmatch[1].rm_so, len); in parse_pos() 529 if (pmatch[2].rm_eo > pmatch[2].rm_so) { in parse_pos() 530 len = pmatch[2].rm_eo - pmatch[2].rm_so - 1; in parse_pos() 533 memcpy(c, s + pmatch[2].rm_so + 1, len); in parse_pos() 558 if (pmatch[3].rm_eo > pmatch[3].rm_so) { in parse_pos() 561 for (i = pmatch[3].rm_so; i < pmatch[3].rm_eo; i++) { in parse_pos() 650 if (pmatch[0].rm_eo <= pmatch[0].rm_so) in parse_pos_obs() [all …]
|
| /openbsd/src/usr.bin/tmux/ |
| D | regsub.c | 48 if (i < n && m[i].rm_so != m[i].rm_eo) { in regsub_expand() 49 regsub_copy(buf, len, text, m[i].rm_so, in regsub_expand() 88 regsub_copy(&buf, &len, text, last, m[0].rm_so + start); in regsub() 96 start + m[0].rm_so != last || in regsub() 97 m[0].rm_so != m[0].rm_eo) { in regsub()
|
| /openbsd/src/usr.bin/grep/ |
| D | util.c | 228 pmatch.rm_so += offset; in procline() 234 pmatch.rm_so = offset; in procline() 239 if (pmatch.rm_so != 0 || pmatch.rm_eo != l->len) in procline() 244 if (oflag && pmatch.rm_so != pmatch.rm_eo) in procline() 511 pmatch->rm_so = -1; in grep_search() 533 pmatch->rm_so = j; in grep_search() 536 pmatch->rm_so, pmatch->rm_eo)) in grep_search() 546 pmatch->rm_so = j - fg->patternLen; in grep_search() 549 pmatch->rm_so, pmatch->rm_eo)) { in grep_search() 564 pmatch->rm_so = j; in grep_search() [all …]
|
| /openbsd/src/usr.bin/vi/common/ |
| D | search.c | 228 match[0].rm_so = coff; in f_search() 233 (match[0].rm_so == 0 ? 0 : REG_NOTBOL) | REG_STARTEND); in f_search() 249 rm->cno = match[0].rm_so; in f_search() 353 match[0].rm_so = 0; in b_search() 370 if (coff != 0 && match[0].rm_so >= coff) in b_search() 384 last = match[0].rm_so++; in b_search() 385 if (match[0].rm_so >= len) in b_search() 389 (match[0].rm_so == 0 ? 0 : REG_NOTBOL) | in b_search() 400 if (coff && match[0].rm_so >= coff) in b_search()
|
| /openbsd/src/gnu/llvm/llvm/lib/Support/ |
| D | Regex.cpp | 101 pm[0].rm_so = 0; in match() 122 if (pm[i].rm_so == -1) { in match() 127 assert(pm[i].rm_eo >= pm[i].rm_so); in match() 128 Matches->push_back(StringRef(String.data()+pm[i].rm_so, in match() 129 pm[i].rm_eo-pm[i].rm_so)); in match()
|
| D | regex_impl.h | 44 llvm_regoff_t rm_so; /* start of match */ member
|
| D | regengine.inc | 152 start = string + pmatch[0].rm_so; 220 m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; 252 assert(m->pmatch[i].rm_so == -1); 272 pmatch[0].rm_so = m->coldp - m->offp; 281 pmatch[i].rm_so = -1; 503 m->pmatch[i].rm_so = sp - m->offp; 630 assert(m->pmatch[i].rm_so != -1); 631 len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; 637 ssp = m->offp + m->pmatch[i].rm_so; 691 offsave = m->pmatch[i].rm_so; [all …]
|
| /openbsd/src/usr.bin/sed/ |
| D | process.c | 360 if (n <= 1 && (match[0].rm_so > le)) in substitute() 361 cspace(&SS, s, match[0].rm_so - le, APPEND); in substitute() 364 if (lastempty || (match[0].rm_so - le) || in substitute() 365 match[0].rm_so != match[0].rm_eo) { in substitute() 389 if (match[0].rm_so == match[0].rm_eo) { in substitute() 527 match[0].rm_so = start; in regexec_e() 573 } else if (match[no].rm_so != -1 && match[no].rm_eo != -1) { in regsub() 574 len = match[no].rm_eo - match[no].rm_so; in regsub() 576 memmove(dst, string + match[no].rm_so, len); in regsub()
|
| /openbsd/src/usr.bin/m4/ |
| D | gnum4.c | 275 else if (pm[n].rm_so != -1 && in add_sub() 277 addchars(string + pm[n].rm_so, in add_sub() 278 pm[n].rm_eo - pm[n].rm_so); in add_sub() 338 if (pm[0].rm_so == pm[0].rm_eo && in do_subst() 339 string + pm[0].rm_so == last_match) { in do_subst() 349 last_match = string + pm[0].rm_so; in do_subst() 350 addchars(string, pm[0].rm_so); in do_subst() 385 pbunsigned(pm[0].rm_so); in do_regexpindex()
|
| /openbsd/src/gnu/usr.bin/gcc/gcc/fixinc/ |
| D | fixfixes.c | 142 fwrite (text, rm[0].rm_so, 1, stdout); 145 const char* ps = text + rm[1].rm_so; 230 if (pRM->rm_so < 0) 233 len = pRM->rm_eo - pRM->rm_so; 235 fwrite(text + pRM->rm_so, len, 1, stdout); 295 fwrite( text, rm[0].rm_so, 1, stdout ); in FIX_PROC_HEAD() 556 p = base + match[0].rm_so; in FIX_PROC_HEAD()
|
| /openbsd/src/gnu/gcc/fixincludes/ |
| D | fixfixes.c | 136 fwrite (text, rm[0].rm_so, 1, stdout); in emit_gnu_type() 139 const char* ps = text + rm[1].rm_so; in emit_gnu_type() 220 if (pRM->rm_so < 0) in format_write() 223 len = pRM->rm_eo - pRM->rm_so; in format_write() 225 fwrite(text + pRM->rm_so, len, 1, stdout); in format_write() 285 fwrite( text, rm[0].rm_so, 1, stdout ); in FIX_PROC_HEAD() 547 p = base + match[0].rm_so; in FIX_PROC_HEAD()
|
| /openbsd/src/lib/libc/regex/ |
| D | engine.c | 151 start = string + pmatch[0].rm_so; in matcher() 219 m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; in matcher() 251 assert(m->pmatch[i].rm_so == -1); in matcher() 271 pmatch[0].rm_so = m->coldp - m->offp; in matcher() 280 pmatch[i].rm_so = -1; in matcher() 456 m->pmatch[i].rm_so = sp - m->offp; in dissect() 579 assert(m->pmatch[i].rm_so != -1); in backref() 580 len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; in backref() 586 ssp = m->offp + m->pmatch[i].rm_so; in backref() 640 offsave = m->pmatch[i].rm_so; in backref() [all …]
|
| /openbsd/src/usr.bin/less/ |
| D | pattern.c | 122 rm.rm_so = 0; in match_pattern() 129 *sp = line + rm.rm_so; in match_pattern()
|
| /openbsd/src/lib/libkeynote/ |
| D | keynote.y | 532 for (i = 1; i < 32 && pmatch[i].rm_so != -1; i++) 534 gr = calloc(pmatch[i].rm_eo - pmatch[i].rm_so + 544 strncpy(gr, $1 + pmatch[i].rm_so, 545 pmatch[i].rm_eo - pmatch[i].rm_so); 546 gr[pmatch[i].rm_eo - pmatch[i].rm_so] = '\0';
|
| /openbsd/src/bin/pax/ |
| D | pat_rep.c | 955 rpt = inpt + pm[0].rm_so; in rep_name() 987 inpt += pm[0].rm_eo - pm[0].rm_so; in rep_name() 1094 if ((pmpt->rm_so < 0) || (pmpt->rm_eo < 0) || in resub() 1095 ((len = pmpt->rm_eo - pmpt->rm_so) <= 0)) in resub() 1104 strncpy(dpt, inpt + pmpt->rm_so, len); in resub()
|
| /openbsd/src/usr.bin/vi/ex/ |
| D | ex_subst.c | 534 nextmatch: match[0].rm_so = offset; in s() 575 if (match[0].rm_so == nempty && match[0].rm_eo == nempty) { in s() 593 from.cno = match[0].rm_so; in s() 672 sp->cno = match[0].rm_so; in s() 675 BUILD(sp, s + offset, match[0].rm_so - offset); in s() 1291 subzero: if (match[no].rm_so == -1 || in re_sub() 1294 mlen = match[no].rm_eo - match[no].rm_so; in re_sub() 1295 for (t = ip + match[no].rm_so; mlen--; ++t) in re_sub()
|
| /openbsd/src/bin/expr/ |
| D | expr.c | 261 if (regexec(&rp, l->u.s, 2, rm, 0) == 0 && rm[0].rm_so == 0) { in eval5() 262 if (rm[1].rm_so >= 0) { in eval5() 264 v = make_str(l->u.s + rm[1].rm_so); in eval5() 267 v = make_int(rm[0].rm_eo - rm[0].rm_so); in eval5()
|
| /openbsd/src/regress/sys/kern/pledge/generic/ |
| D | manager.c | 136 ret = strtonum(&output[matches[1].rm_so], 0, 255, &errstr); in grab_syscall() 139 &output[matches[1].rm_so], errstr); in grab_syscall()
|
| /openbsd/src/include/ |
| D | regex.h | 55 regoff_t rm_so; /* start of match */ member
|
| /openbsd/src/usr.bin/make/ |
| D | varmodifiers.c | 623 if (pat->matches[0].rm_so > 0) { in VarRESubstitute() 625 Buf_AddChars(buf, pat->matches[0].rm_so, wp); in VarRESubstitute() 658 } else if (pat->matches[n].rm_so == -1 && in VarRESubstitute() 665 subbuf = wp + pat->matches[n].rm_so; in VarRESubstitute() 667 pat->matches[n].rm_so; in VarRESubstitute()
|
| /openbsd/src/gnu/usr.bin/cvs/lib/ |
| D | regex.h | 397 regoff_t rm_so; /* Byte offset from string's start to substring's start. */ member
|