【发布时间】:2012-07-10 23:10:09
【问题描述】:
>>> match = re.findall(r'\w\w', 'hello')
>>> print match
['he', 'll']
由于 \w\w 表示两个字符,因此需要“he”和“ll”。但是为什么 'el' 和 'lo' 不 匹配正则表达式?
>>> match1 = re.findall(r'el', 'hello')
>>> print match1
['el']
>>>
【问题讨论】:
标签: python regex overlapping