def METHOD_NAME(self, regex_compiled, html, html_to_find):
    html_to_find = [text_type(html_bit) for html_bit in html_to_find]
    partly_matching_tags = []
    html_str = self._get_html_from_res(html)
    for tag in regex_compiled.finditer(html_str):
        found_all = True
        for i, html_bit_to_find in enumerate(html_to_find):
            assert isinstance(
                html_bit_to_find, string_types
            ), html_bit_to_find
            html_bit_to_find = text_type(html_bit_to_find)
            find_inverse = html_bit_to_find.startswith("!")
            if (find_inverse and html_bit_to_find[1:] in tag.group()) or (
                not find_inverse and html_bit_to_find not in tag.group()
            ):
                found_all = False
                if i > 0:
                    partly_matching_tags.append(tag.group())
                break
        if found_all:
            return  # found it
    # didn't find it
    if partly_matching_tags:
        assert 0, "Couldn't find %s in html. Closest matches were:\n%s" % (
            ", ".join(
                ["'%s'" % html.encode("utf8") for html in html_to_find]
            ),
            "\n".join(
                [tag.encode("utf8") for tag in partly_matching_tags]
            ),
        )
    else:
        assert 0, "Couldn't find %s in html. Tags matched were:\n%s" % (
            ", ".join(
                ["'%s'" % html.encode("utf8") for html in html_to_find]
            ),
            "\n".join(
                [tag.group() for tag in regex_compiled.finditer(html_str)]
            ),
        )