匹配[key]的正则表达式与Split()
r"\[( *[A-Za-z]*)*\]"
def Split(sourceStr):
""" Get a list from sourceStr split by spaces or new lines """
return re.split(" *",sourceStr.replace('\n', ' ').strip())
r"\[( *[A-Za-z]*)*\]"
def Split(sourceStr):
""" Get a list from sourceStr split by spaces or new lines """
return re.split(" *",sourceStr.replace('\n', ' ').strip())