Rondevous <rondevu.mis...@protonmail.com> added the comment:
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. ---------- _______________________________________ 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