Rondevous <rondevu.mis...@protonmail.com> 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 non-capturing groups is mentioned in the 
docs of re.findall, it would help those who have learnt regex from another 
language (like javascript), where the global flag in regex is allowed.

I want the docs of re.findall and re.finditer to somehow suggest the use 
(?:group) to return the original matches and not the captured groups.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44940>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to