小编use*_*080的帖子

Python:重叠正则表达式搜索

因此,如果我在 python (3.7) 中创建一个如下所示的程序:

import re
regx = re.compile("test")
print(regx.findall("testest"))
Run Code Online (Sandbox Code Playgroud)

并运行它,然后我会得到:

["test"]
Run Code Online (Sandbox Code Playgroud)

即使有两个“测试”实例,它也只向我展示了一个,我认为这是因为第二个“测试”中使用了第一个“测试”中的字母。我怎样才能制作一个程序来["test", "test"]代替我?

python regex

-1
推荐指数
1
解决办法
99
查看次数

标签 统计

python ×1

regex ×1