def METHOD_NAME(row: str | list[str] | tuple[str], matched=dict[str, list]):
    def _check_single_string(row: str, matched: dict[str, list]) -> dict[str, list]:
        for exp in RE_TO_CHECK:
            if exp.match(row) is not None:
                matched[exp].append(row)
        for string in STRINGS_TO_CHECK:
            if string.lower() in row.lower():
                string_idx = row.lower().index(string.lower())
                matched[string].append(row[max(string_idx - 50, 0) : string_idx + 50])
        return matched
    if isinstance(row, str):
        matched = _check_single_string(row, matched)
    elif isinstance(row, (list, tuple)):
        for r in row:
            if not isinstance(r, str):
                raise ValueError(f"Unexpected type: {type(row)}")
            matched = _check_single_string(r, matched)
    elif isinstance(row, DatasetEntrySft):
        formatted = row.get_formatted(eos_token="</s>")
        for r in formatted:
            if not isinstance(r, str):
                raise ValueError(f"Unexpected type: {type(r)}")
            matched = _check_single_string(
                r.replace("<|assistant|>", "").replace("<|prompter|>", "").replace("</s>", ""), matched
            )
    elif isinstance(row, DatasetEntryLm):
        matched = _check_single_string(row.text, matched)
    else:
        raise ValueError(f"Received unexpected type: {type(row)}.")
    return matched