gpt4 book ai didi

python - re.findall 的结果顺序有保证吗?

转载 作者:太空狗 更新时间:2023-10-29 22:06:33 25 4
gpt4 key购买 nike

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com