2015-04-29 71 views

回答

2

你只是迭代你的字典,并在键上进行模式匹配。

for key in dict: 
    if re.match(r'npi[0-9]+', key): 
     print(dict[key])