public Region match(String str, int from) { byte[] strBytes = str.getBytes(); Matcher matcher = this.pattern.matcher(strBytes, 0, strBytes.length); if (matcher.search(from, strBytes.length, 0) >= 0) { return matcher.getEagerRegion(); } return null; }
Region region = matcher.getEagerRegion(); String key = getKey(messageAsBytes, region);
public List<Match> matches(String text) throws InterruptedException { List<Match> matches = new ArrayList<>(); byte[] textAsBytes = text.getBytes(StandardCharsets.UTF_8); Matcher matcher = compiledExpression.matcher(textAsBytes); int result = matcher.search(0, textAsBytes.length, Option.MULTILINE); boolean matchNotFound = result == -1; if (matchNotFound) { return null; } if (result == INTERRUPTED) { throw new InterruptedException(); } if (compiledExpression.numberOfNames() == 0) { return matches; } Region region = matcher.getEagerRegion(); for (Iterator<NameEntry> iterator = compiledExpression.namedBackrefIterator(); iterator.hasNext();) { NameEntry entry = iterator.next(); String groupName = extractString(entry.name, entry.nameP, entry.nameEnd); int[] matchNumbers = entry.getBackRefs(); matches.add(match(groupName, region, textAsBytes, matchNumbers)); } return matches; }
Region region = matcher.getEagerRegion(); String patternName = matchPatternValue(PATTERN_GROUP, region, grokPattern); String subName = matchPatternValue(SUBNAME_GROUP, region, grokPattern);
Region region = matcher.getEagerRegion(); String namedPatternRef = groupMatch(NAME_GROUP, region, grokPattern); String subName = groupMatch(SUBNAME_GROUP, region, grokPattern);
Region region = matcher.getEagerRegion(); for (Iterator<NameEntry> entry = compiledExpression.namedBackrefIterator(); entry.hasNext();) { NameEntry e = entry.next();
Region region = matcher.getEagerRegion();