>>> 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) 假设我有字符串
"12345"
Run Code Online (Sandbox Code Playgroud)
如果我.match(/\d{3}/g),我只得到一场比赛,"123".我为什么不来[ "123", "234", "345" ]?