from __future__ import annotations
import re
from typing import Iterable

def contains_any(text: str, words: Iterable[str], *, casefold: bool = True) -> bool:
    if not text:
        return False
    hay = text.casefold() if casefold else text
    for w in words:
        if not w:
            continue
        needle = w.casefold() if casefold else w
        if needle in hay:
            return True
    return False

def regex_any(text: str, patterns: Iterable[str], *, flags: int = re.IGNORECASE) -> bool:
    if not text:
        return False
    for pat in patterns:
        if not pat:
            continue
        if re.search(pat, text, flags=flags):
            return True
    return False