re.findall
返回的匹配列表是否始终与它们在源文本中的顺序相同?
最佳答案
是的,如 re
模块中所述 docs :
Return all non-overlapping matches of pattern in string, as a list of strings. The string is scanned left-to-right, and matches are returned in the order found.
关于python - re.findall 的结果顺序有保证吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35133386/