发布网友 发布时间:2022-09-28 22:34
共1个回答
热心网友 时间:2024-08-17 10:17
re.findall('\\w*{}\\w*'.format(c),','.join(l))
Python 3.5.2 (default, Dec 7 2016, 23:38:49)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> l=['sfdsd','ddff']
>>> c='s'
>>> re.findall('\\w*{}\\w*'.format(c),','.join(l))
['sfdsd']