class RegexAntiPatternFilter extends RegexRuleFilter {

  @Nullable
  @Override
  public RuleMatch acceptRuleMatch(RuleMatch match, Map<String, String> arguments, AnalyzedSentence sentenceObj, Matcher patternMatcher) {<FILL_FUNCTION_BODY>}
}

    String antiPatternStr = arguments.get("antipatterns");
    if (antiPatternStr == null) {
      throw new RuntimeException("Missing 'antiPatterns:' in 'args' in <filter> of rule " + match.getRule().getFullId());
    }
    String[] antiPatterns = antiPatternStr.split("\\|");
    for (String antiPattern : antiPatterns) {
      Pattern p = Pattern.compile(antiPattern);
      Matcher matcher = p.matcher(sentenceObj.getText());
      if (matcher.find()) {
        // partial overlap is enough to filter out a match:
        if (matcher.start() <= match.getToPos() && matcher.end() >= match.getToPos() ||
            matcher.start() <= match.getFromPos() && matcher.end() >= match.getFromPos()) {
          return null;
        }
      }
    }
    return match;
  
<methods>public non-sealed void <init>() ,public abstract org.languagetool.rules.RuleMatch acceptRuleMatch(org.languagetool.rules.RuleMatch, Map<java.lang.String,java.lang.String>, org.languagetool.AnalyzedSentence, java.util.regex.Matcher) <variables>