Lines Matching refs:index
519 state_getslice(SRE_STATE* state, Py_ssize_t index, PyObject* string, int empty)
523 index = (index - 1) * 2;
525 if (string == Py_None || index >= state->lastmark || !state->mark[index] || !state->mark[index+1]) {
533 i = STATE_OFFSET(state, state->mark[index]);
534 j = STATE_OFFSET(state, state->mark[index+1]);
2022 match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
2031 assert(0 <= index && index < self->groups);
2032 index *= 2;
2034 if (self->string == Py_None || self->mark[index] < 0) {
2044 i = self->mark[index];
2045 j = self->mark[index+1];
2055 match_getindex(MatchObject* self, PyObject* index)
2059 if (index == NULL)
2063 if (PyIndex_Check(index)) {
2064 i = PyNumber_AsSsize_t(index, NULL);
2070 index = PyDict_GetItemWithError(self->pattern->groupindex, index);
2071 if (index && PyLong_Check(index)) {
2072 i = PyLong_AsSsize_t(index);
2088 match_getslice(MatchObject* self, PyObject* index, PyObject* def)
2090 Py_ssize_t i = match_getindex(self, index);
2173 Py_ssize_t index;
2179 for (index = 1; index < self->groups; index++) {
2181 item = match_getslice_by_index(self, index, default_value);
2186 PyTuple_SET_ITEM(result, index-1, item);
2243 Return index of the start of the substring matched by group.
2250 Py_ssize_t index = match_getindex(self, group);
2252 if (index < 0) {
2257 return self->mark[index*2];
2266 Return index of the end of the substring matched by group.
2273 Py_ssize_t index = match_getindex(self, group);
2275 if (index < 0) {
2280 return self->mark[index*2+1];
2323 Py_ssize_t index = match_getindex(self, group);
2325 if (index < 0) {
2330 return _pair(self->mark[index*2], self->mark[index*2+1]);
2338 Py_ssize_t index;
2344 for (index = 0; index < self->groups; index++) {
2345 item = _pair(self->mark[index*2], self->mark[index*2+1]);
2350 PyTuple_SET_ITEM(regs, index, item);
2849 "The integer index of the last matched capturing group."},
2863 "The index into the string at which the RE engine started looking for a match."},
2865 "The index into the string beyond which the RE engine will not go."},