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 rondevous
Recipients docs@python, rondevous, serhiy.storchaka, veky
Date 2021-08-20.16:01:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629475276.89.0.480735876811.issue44940@roundup.psfhosted.org>
In-reply-to
Content
To clarify in short: the pattern I mentioned doesn't give the result I expected in re.findall() unlike re.search()

Given pattern:  (foo)?bar|cool

Maybe my approach in testing the regex first using re.search() and then using re.findall() to return all matches was wrong.

Initially, after going through help(re) I had associated re.findall with the 'global' flag used in javascript regex which would return all the matches. Without the global flag (in javascript) only the first match is returned, like re.search() in python.
History
Date User Action Args
2021-08-20 16:01:17rondevoussetrecipients: + rondevous, docs@python, serhiy.storchaka, veky
2021-08-20 16:01:16rondevoussetmessageid: <1629475276.89.0.480735876811.issue44940@roundup.psfhosted.org>
2021-08-20 16:01:16rondevouslinkissue44940 messages
2021-08-20 16:01:16rondevouscreate