>>> match = re.findall(r'\w\w', 'hello')
>>> print match
['he', 'll']
Run Code Online (Sandbox Code Playgroud)
因为\ w\w意味着两个字符,'他'和'll'是预期的.但为什么'el'和'lo' 与正则表达式不匹配?
>>> match1 = re.findall(r'el', 'hello')
>>> print match1
['el']
>>>
Run Code Online (Sandbox Code Playgroud)