Исправлен индекс совпадения при поиске по регулярке

This commit is contained in:
serega6531
2020-03-09 20:40:38 +03:00
parent 61e6e39532
commit 3d2b5f0647

View File

@@ -74,9 +74,9 @@ public class PatternService {
found.add(FoundPattern.builder() found.add(FoundPattern.builder()
.patternId(pattern.getId()) .patternId(pattern.getId())
.startPosition(matcher.start()) .startPosition(matcher.start())
.endPosition(matcher.end()) .endPosition(matcher.end() - 1)
.build()); .build());
startPos = matcher.end() + 1; startPos = matcher.end();
} }
return found; return found;