def pattern_to_list(self, pattern):
    ret = []

    for e1 in pattern.split(','):
        if e1.strip().isdigit():
            ret.append(int(e1.strip()))
        elif e1.strip().find('-') >= 0:
            s, e = e1.strip().split('-')
            ret += range(int(s.strip()), int(e.strip())+1)

    return ret