private void backref(int mem) { if (mem > regex.numMem || backrefInvalid(mem)) {opFail(); return;} int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; while (n-- > 0) if (bytes[pstart++] != bytes[s++]) {opFail(); return;} if (sprev < range) { // beyond string check int len; while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } }
private void backref(int mem) { if (mem > regex.numMem || backrefInvalid(mem)) {opFail(); return;} int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; while (n-- > 0) if (bytes[pstart++] != bytes[s++]) {opFail(); return;} if (sprev < range) { // beyond string check int len; while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } }
private void opBackRefMulti() { int tlen = code[ip++]; int i; loop:for (i=0; i<tlen; i++) { int mem = code[ip++]; if (backrefInvalid(mem)) continue; int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; int swork = s; while (n-- > 0) { if (bytes[pstart++] != bytes[swork++]) continue loop; } s = swork; int len; // beyond string check if (sprev < range) { while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } ip += tlen - i - 1; // * SIZE_MEMNUM (1) break; /* success */ } if (i == tlen) {opFail(); return;} }
private void opBackRefMulti() { int tlen = code[ip++]; int i; loop:for (i=0; i<tlen; i++) { int mem = code[ip++]; if (backrefInvalid(mem)) continue; int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; int swork = s; while (n-- > 0) { if (bytes[pstart++] != bytes[swork++]) continue loop; } s = swork; int len; // beyond string check if (sprev < range) { while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } ip += tlen - i - 1; // * SIZE_MEMNUM (1) break; /* success */ } if (i == tlen) {opFail(); return;} }
private void opBackRefNIC() { int mem = code[ip++]; if (mem > regex.numMem || backrefInvalid(mem)) {opFail(); return;} int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; value = s; if (!stringCmpIC(regex.caseFoldFlag, pstart, this, n, end)) {opFail(); return;} s = value; if (sprev < range) { int len; while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } }
private void opBackRefMultiIC() { int tlen = code[ip++]; int i; loop:for (i=0; i<tlen; i++) { int mem = code[ip++]; if (backrefInvalid(mem)) continue; int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; value = s; if (!stringCmpIC(regex.caseFoldFlag, pstart, this, n, end)) continue loop; // STRING_CMP_VALUE_IC s = value; int len; if (sprev < range) { while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } ip += tlen - i - 1; // * SIZE_MEMNUM (1) break; /* success */ } if (i == tlen) {opFail(); return;} }
private void opBackRefMultiIC() { int tlen = code[ip++]; int i; loop:for (i=0; i<tlen; i++) { int mem = code[ip++]; if (backrefInvalid(mem)) continue; int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; value = s; if (!stringCmpIC(regex.caseFoldFlag, pstart, this, n, end)) continue loop; // STRING_CMP_VALUE_IC s = value; int len; if (sprev < range) { while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } ip += tlen - i - 1; // * SIZE_MEMNUM (1) break; /* success */ } if (i == tlen) {opFail(); return;} }
private void opBackRefNIC() { int mem = code[ip++]; if (mem > regex.numMem || backrefInvalid(mem)) {opFail(); return;} int pstart = backrefStart(mem); int pend = backrefEnd(mem); int n = pend - pstart; if (s + n > range) {opFail(); return;} sprev = s; value = s; if (!stringCmpIC(regex.caseFoldFlag, pstart, this, n, end)) {opFail(); return;} s = value; if (sprev < range) { int len; while (sprev + (len = enc.length(bytes, sprev, end)) < s) sprev += len; } }