Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: All work as designed. In your example you don't see a difference because all groups are defined. Look at other example:
>>> import re >>> m = re.match(r'(?:(\w+)@)?(\w+)\.(\w+)', 'hackerrank.com') >>> m.groups() (None, 'hackerrank', 'com') >>> m.groups(1) (1, 'hackerrank', 'com') >>> m.groups(100000000000) (100000000000, 'hackerrank', 'com') ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31969> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com