import re


def _expand_h(string):
    """ Convert Huawei-style port ranges into list of ports """
    result = []
    for element in re.split('(?<!to) (?!to)', string):
        m = re.match('(\d+) to (\d+)', element)
        if m:
            for num in range(int(m.group(1)), int(m.group(2)) + 1):
                result.append(str(num))
        else:
            result.append(element)
    return result