def search(regex: str, df, case=False):
    """Search all the text columns of `df`, return rows with any matches."""
    textlikes = df.select_dtypes(include=[object, "string"])
    return df[
        textlikes.apply(
            lambda column: column.str.contains(
                regex,
                regex=True,
                case=case,
                na=False)
        ).any(axis=1)
    ]