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 HaujetZhao, ezio.melotti, mrabarnett, rhettinger, rondevous, serhiy.storchaka
Date 2021-08-17.20:59:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629233969.0.0.61155218116.issue42448@roundup.psfhosted.org>
In-reply-to
Content
I was frustrated for hours when I couldn't figure out why this won't match:

>>> re.findall(r'(foo)?bar|cool', 'cool')

Now I know, I have to make this change: (?:foo)
But this isn't obvious.
Should it be mentioned in the docs of re.findall() to use (?:...) for non-capturing groups?
History
Date User Action Args
2021-08-17 20:59:29rondevoussetrecipients: + rondevous, rhettinger, ezio.melotti, mrabarnett, serhiy.storchaka, HaujetZhao
2021-08-17 20:59:28rondevoussetmessageid: <1629233969.0.0.61155218116.issue42448@roundup.psfhosted.org>
2021-08-17 20:59:28rondevouslinkissue42448 messages
2021-08-17 20:59:28rondevouscreate