import re


def find_text_between(start, end, haystack: bytes):
    """
    Return text between the first occurrence of string start and string end
    in haystack.
    """
    found = re.search(
        start + "(.*)" + end, haystack.decode(), re.IGNORECASE | re.DOTALL
    )
    if found:
        return found.group(1).strip()

    else:
        raise Exception(
            "There is no substring starting with '{}', ending"
            " with '{}' in content '{}' ".format(start, end, haystack)
        )