This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author HaujetZhao
Recipients HaujetZhao, ezio.melotti, mrabarnett
Date 2020-11-23.19:30:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606159857.65.0.962689074974.issue42448@roundup.psfhosted.org>
In-reply-to
Content
```
>>> import re
>>> text = '121212 and 121212'
>>> pattern = '(12)+'
>>> print(re.findall(pattern, text))
['12', '12']
>>> 
>>> 
>>> print(re.search(pattern, text))
<re.Match object; span=(0, 6), match='121212'>
>>> 
>>> 
>>> print(re.sub(pattern, '', text))
 and 
# The re.findall have different search result against re.search or re.sub
# re.findall 和 re.search 、 re.sub 的匹配结果不相同
```

With same pattern and string, the re.findall is supposed to have same match with re.search, but it didn't. 

This result is from python3.8.5
History
Date User Action Args
2020-11-23 19:30:57HaujetZhaosetrecipients: + HaujetZhao, ezio.melotti, mrabarnett
2020-11-23 19:30:57HaujetZhaosetmessageid: <1606159857.65.0.962689074974.issue42448@roundup.psfhosted.org>
2020-11-23 19:30:57HaujetZhaolinkissue42448 messages
2020-11-23 19:30:57HaujetZhaocreate