[issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs

2021-08-20 Thread Vedran Čačić
Vedran Čačić added the comment: Also, maybe you should read the following sentence (also in the docs): > If one wants more information about all matches of a pattern than the matched > text, finditer() is useful as it provides match objects instead of strings. It seems that's what you wanted

[issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs

2021-08-20 Thread Vedran Čačić
Vedran Čačić added the comment: Have you seen the patch? In the patched docs, non-capturing grouping is explicitly mentioned. (Though I myself wouldn't include even that, as it's superfluous with what's said before, obviously it's needed.:) -- ___

[issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs

2021-08-20 Thread Rondevous
Rondevous added the comment: To produce the same results that you'd get by using the global flag in javascript regex, and make re.findall to not capture the groups exclusively, all the groups in the pattern need to be of the non-capturing (?:) type. If the distinction about capturing and

[issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs

2021-08-20 Thread Rondevous
Rondevous added the comment: Maybe the functionality of re.findall and re.finditer is limited because, e.g. I can't do something like this: https://stackoverflow.com/questions/3512471/what-is-a-non-capturing-group-in-regular-expressions#3513858 The workaround for doing that might need me to

[issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs

2021-08-20 Thread Rondevous
Rondevous added the comment: >From my understanding, "|" should match either the RegEx on the left or the >RegEx on the right of the pipe >>> help(re): "|" A|B, creates an RE that will match either A or B. With re.search(), the pattern below matches 'cool' as well as 'foo' >>>