import re


def parseVtxIdx(idxList):
    """convert vertex index list from strings to indexes.
    idxList : [u'vtx[1]', u'vtx[3]', u'vtx[6]', u'vtx[8]', u'vtx[12:13]']
    return : [1,3,6,8,12,13]
    """

    parseIdxList = []

    for idxName in idxList:
        match = re.search(r'\[.+\]', idxName)
        if match:
            content = match.group()[1:-1]
            if ':' in content:
                tokens = content.split(':')
                startTok = int(tokens[0])
                endTok = int(tokens[1])

                for rangeIdx in range(startTok, endTok + 1):
                    parseIdxList.append(rangeIdx)

            else:
                parseIdxList.append(int(content))

    return parseIdxList