import re


def get_substr_all(st, de1, de2, strip=True, sort=False):
    """
    Return all occurrences of substring between delimiters delim1 and delim2
    from a string. If strip is set true, strip the result. If sort is true,
    sort results before returning. Returns None if nothing was found.
    :param st: String from which we search for substr
    :param de1: First delimiter (string)
    :param de2: Second delimiter (string)
    :param strip: Toggle result stripping (boolean)
    :param sort: Toggle result sorting (boolean)
    :return: List or None
    """
    if (not st or st == '' or not de1 or de1 == '' or not de2 or de2 == ''
            or not isinstance(strip, bool) or not isinstance(sort, bool)):
        raise ValueError

    ret = re.findall(de1 + '(.*?)' + de2, st, re.DOTALL)

    if not ret:
        return None

    if strip:
        ret = [r.strip() for r in ret]

    if sort:
        ret = sorted(ret)

    return ret