return next match in input
433989
function () {
        if (this.done) {
            return this.EOF;
        }
        if (!this._input) {
            this.done = true;
        }

        var token,
            match,
            tempMatch,
            index;
        if (!this._more) {
            this.yytext = '';
            this.match = '';
        }
        var rules = this._currentRules();
        for (var i = 0; i < rules.length; i++) {
            tempMatch = this._input.match(this.rules[rules[i]]);
            if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
                match = tempMatch;
                index = i;
                if (this.options.backtrack_lexer) {
                    token = this.test_match(tempMatch, rules[i]);
                    if (token !== false) {
                        return token;
                    } else if (this._backtrack) {
                        match = false;
                        continue; // rule action called reject() implying a rule MISmatch.
                    } else {
                        // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
                        return false;
                    }
                } else if (!this.options.flex) {
                    break;
                }
            }
        }
        if (match) {
            token = this.test_match(match, rules[index]);
            if (token !== false) {
                return token;
            }
            // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
            return false;
        }
        if (this._input === "") {
            return this.EOF;
        } else {
            return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
                text: "",
                token: null,
                line: this.yylineno
            });
        }
    }
536132
function findNext(array, item) {
  return array[(Util.findIndex(array, el => el === item) + 1) % array.length]
}
932204
def incremental_filter(input, list, delim)
      i = 0; input.gsub(delim) {|e| i+= 1 }
      delim_chars = delim.split('').uniq.join('')
      current_matches, future_matches = default_search(input, list).partition {|e|
        e[/^[^#{delim_chars}]*(#{delim}[^#{delim_chars}]+){0,#{i}}$/] }
      (current_matches + future_matches.map {|e| e[/^(([^#{delim_chars}]*#{delim}){0,#{i+1}})/, 1] }).uniq
    end
1095327
def matches_input(self, optimized_str):
        """"""

        if all([keyword in optimized_str for keyword in self['keywords']]):
            logger.debug('Matched template %s', self['template_name'])
            return True
1092380
def __get_match_result(self, ret, ret2):
        
        if self.another_compare == "__MATCH_AND__":
            return ret and ret2
        elif self.another_compare == "__MATCH_OR__":
            return ret or ret2
        return ret
403269
def next_match char
      start = @current_index
      start.upto(@list.length-1) do |ix|
        if @list[ix][0,1].casecmp(char) == 0
          return @list[ix] unless @list[ix] == @buffer
        end
        @current_index += 1
      end
      ## could not find, start from zero
      @current_index = 0
      start = [@list.length()-1, start].min
      0.upto(start) do |ix|
        if @list[ix][0,1].casecmp(char) == 0
          return @list[ix] unless @list[ix] == @buffer
        end
        @current_index += 1
      end
      @current_index = [@list.length()-1, @current_index].min
      return nil
    end
148932
def find_next(self):
        """"""
        state = self.find(changed=False, forward=True, rehighlight=False,
                          multiline_replace_check=False)
        self.editor.setFocus()
        self.search_text.add_current_text()
        return state
536395
def highlightNextMatch(self):
        
        # If this method was called on an empty input field (ie.
        # if the user hit <ctrl>+s again) then pick the default
        # selection.
        if self.qteText.toPlainText() == '':
            self.qteText.setText(self.defaultChoice)
            return

        # If the mathIdx variable is out of bounds (eg. the last possible
        # match is already selected) then wrap it around.
        if self.selMatchIdx < 0:
            self.selMatchIdx = 0
            return
        if self.selMatchIdx >= len(self.matchList):
            self.selMatchIdx = 0
            return

        # Shorthand.
        SCI = self.qteWidget

        # Undo the highlighting of the previously selected match.
        start, stop = self.matchList[self.selMatchIdx - 1]
        line, col = SCI.lineIndexFromPosition(start)
        SCI.SendScintilla(SCI.SCI_STARTSTYLING, start, 0xFF)
        SCI.SendScintilla(SCI.SCI_SETSTYLING, stop - start, 30)

        # Highlight the next match.
        start, stop = self.matchList[self.selMatchIdx]
        SCI.SendScintilla(SCI.SCI_STARTSTYLING, start, 0xFF)
        SCI.SendScintilla(SCI.SCI_SETSTYLING, stop - start, 31)

        # Place the cursor at the start of the currently selected match.
        line, col = SCI.lineIndexFromPosition(start)
        SCI.setCursorPosition(line, col)
        self.selMatchIdx += 1
268039
def next(self):
        """"""
        if self._current_index < len(self._collection):
            value = self._collection[self._current_index]
            self._current_index += 1
            return value
        elif self._next_cursor:
            self.__fetch_next()
            return self.next()
        else:
            self._current_index = 0
            raise StopIteration
1282110
def get_matching(content, match):
    
    if match != "":
        lines = [line for line in content.split("\n") if match in line]
        content = "\n".join(lines)
    return content
265342
def next(self, match, predicate=None, index=None):
        
        current = match.start + 1
        while current <= self._max_end:
            next_matches = self.starting(current)
            if next_matches:
                return filter_index(next_matches, predicate, index)
            current += 1
        return filter_index(_BaseMatches._base(), predicate, index)
1274578
function match(re) {
        const m = re.exec(css);

        if (m) {
            css = css.slice(m[0].length);

            return m;
        }
    }
91802
function(match, value, len, step) {
				var num = '' + value;
				if (doubled(match, step)) {
					while (num.length < len) {
						num = '0' + num;
					}
				}
				return num;
			}
382198
def next_match char
      data = get_content
      row = focussed_index + 1
      row.upto(data.length-1) do |ix|
        #val = data[ix].chomp rescue return  # 2010-01-05 15:28 crashed on trueclass
        val = data[ix].to_s rescue return  # 2010-01-05 15:28 crashed on trueclass
        #if val[0,1] == char #and val != currval
        if val[0,1].casecmp(char) == 0 #AND VAL != CURRval
          return ix
        end
      end
      row = focussed_index - 1
      0.upto(row) do |ix|
        #val = data[ix].chomp
        val = data[ix].to_s
        #if val[0,1] == char #and val != currval
        if val[0,1].casecmp(char) == 0 #and val != currval
          return ix
        end
      end
      return -1
    end
940548
function repeat(input, n) {

    var times = ~~n;

    return (!isString(input) || !times) ? input : strRepeat(input, n);
}
153620
async def get_next_match(self):
        
        if self._final_rank is not None:
            return None

        matches = await self.get_matches(MatchState.open_)

        if len(matches) == 0:
            matches = await self.get_matches(MatchState.pending)

        if len(matches) > 0:
            return matches[0]

        return None
1212960
def match_msequence(self, tokens, item):
        """"""
        series_type, head_matches, middle, _, last_matches = tokens
        self.add_check("_coconut.isinstance(" + item + ", _coconut.abc.Sequence)")
        self.add_check("_coconut.len(" + item + ") >= " + str(len(head_matches) + len(last_matches)))
        if middle != wildcard:
            if len(head_matches) and len(last_matches):
                splice = "[" + str(len(head_matches)) + ":" + str(-len(last_matches)) + "]"
            elif len(head_matches):
                splice = "[" + str(len(head_matches)) + ":]"
            elif len(last_matches):
                splice = "[:" + str(-len(last_matches)) + "]"
            else:
                splice = ""
            self.assign_to_series(middle, series_type, item + splice)
        self.match_all_in(head_matches, item)
        for i, match in enumerate(last_matches):
            self.match(match, item + "[" + str(i - len(last_matches)) + "]")