paths = ['bbb','bbb123ccc']
result = []
for fname in paths:
match1 = re.search('bbb', fname)
match2 = re.search('ccc', fname)
#re.search()方法扫描整个字符串,并返回第一个成功的匹配。如果匹配失败,则返回None。
if match1:
if match2:
result.append(fname)
result
Out[65]: ['bbb123ccc']