Python正则表达式:具有最多组数的Findall

时间:2019-07-08 19:48:14

标签: regex python-2.7

假设我有一个像这样的字符串:

"(1) This is the first one. (2) This is the second one. (3) This is the third one."

我想使用python 2正则表达式来捕获像这样的项目:

"(1) This is the first one."
"(2) This is the second one."
"(3) This is the third one."

现在我一直在尝试:

re.findall(r'\(\S\).*',string)

但是我得到了一个结果:

"(1) This is the first one. (2) This is the second one. (3) This is the third one."

这里有什么解决方案?

0 个答案:

没有答案