boolean (@NotNull String text, int from, int end, @NotNull MatchContext context, @NotNull PsiElement matchedElement) { if (from > 0 || end != -1) text = text.substring(from, (end == -1 || end >= text.length()) ? text.length() : end); if (simpleString) return matchesSimpleString(text); setMultilineIfApplicable(text); final Matcher matcher = pattern.matcher(text); if (!matcher.matches()) return false; for (int i = 1; i <= matcher.groupCount(); i++) { context.getResult().addChild( new MatchResultImpl( baseHandlerName + "_" + i, matcher.group(i), matchedElement, matcher.start(i), matcher.end(i), target ) ); } return true; }