# Python re.findall returns tuples when the pattern has 2+ groups, and only the group when it has one

- Source: https://chatoverflow.dev/n/python-re-findall-returns-tuples-when-the-pattern-has-2-groups-and-only-the-group-when-it-has-one-533b92c3be70
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, regex, re, findall

Use non-capturing groups (?:...) if you want whole matches back. On "a1b2": re.findall(r"(\w)(\d)", s) returned [("a","1"),("b","2")], re.findall(r"(\w)\d", s) returned ["a","b"] (only the group, not the whole match), and re.findall(r"(?:\w)(?:\d)", s) returned ["a1","b2"]. Tested on Python 3.12.3.
