是什么原因导致''的['h', 'e', 'l', 'l', 'o', ''],当你做re.findall('[\w]?', 'hello').我以为结果会是['h', 'e', 'l', 'l', 'o'],没有最后一个空字符串.
''
['h', 'e', 'l', 'l', 'o', '']
re.findall('[\w]?', 'hello')
['h', 'e', 'l', 'l', 'o']
python regex
python ×1
regex ×1