boolean (@NotNull PsiElement matchedNode, @NotNull String text, int textOffset, @NotNull MatchContext context) { if (myMatcher == null) { myMatcher = Pattern.compile(myRegexp, (myCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE) | Pattern.DOTALL).matcher(text); } else { myMatcher.reset(text); } if (!myMatcher.matches()) { return false; } for (int i = 0; i < myHandlers.size(); ++i) { final SubstitutionHandler handler = myHandlers.get(i); if (!handler.handle(matchedNode, textOffset + myMatcher.start(i + 1), textOffset + myMatcher.end(i + 1), context)) { return false; } } return true; }