发布网友 发布时间:2022-04-24 17:52
共1个回答
热心网友 时间:2022-04-18 14:42
In [3]: data=['qwerfyy','dsfha','fdyythg','efggg']
In [4]: [i for i in data if 'yy' in i]
Out[4]: ['qwerfyy', 'fdyythg']
In [5]: import re
In [6]: [i for i in data if re.search('yy',i)]
Out[6]: ['qwerfyy', 'fdyythg']