def METHOD_NAME(self, rule: Rule, tags: Set[int], text: str) -> RuleMatch:
    if rule.has_tag_id and rule.has_tag_id not in tags:
        return
    if rule.has_no_tag_id and rule.has_no_tag_id in tags:
        return
    include_match = None
    if rule.includes_re:
        include_match = rule.includes_re.search(text)
        if include_match is None:
            return
    exclude_match = None
    if rule.excludes_re:
        exclude_match = rule.excludes_re.search(text)
        if exclude_match is not None:
            return
    return (include_match, exclude_match)