next method

  1. @override
int? next(
  1. String line, [
  2. int start = 0
])
override

Looks for the next current pattern. The search starts at index start in line. Returns null if not found or the index of the hit.

Implementation

@override
int? next(String line, [int start = 0]) {
  final line2 = start == 0 ? line : line.substring(start);
  searchEngine.lastMatch.type = LastMatchType.regularExpr;
  searchEngine.lastMatch.regExpMatch = regExp.firstMatch(line2);
  final rc = searchEngine.lastMatch.regExpMatch == null
      ? null
      : start + searchEngine.lastMatch.regExpMatch!.start;
  searchEngine.lastMatch.position.column = rc ?? -1;
  return rc;
}