我在这个网站学习表达模块
http://www.thomas-cokelaer.info/tutorials/python/module_re.html
我做了9.1中的第一个练习
s = ['airplane', 'base', 'ALLIGATOR', 'Broad' ]
filter((lambda x: re.match(r'A', x)),s)
答案是['ALLIGATOR']
但我知道
^{pr2}$
我的回答不是['ALLIGATOR']
我使用的是python3.4.2
有什么问题吗?在
Tags:
引用documentation
要获得这些元素,您需要一个循环或使用
next
或者
^{pr2}$相关问题 更多 >
编程相关推荐