Must be a duplication but I can\'t seem to find it...
I am using a group to match a repeating sub-string. However, I do not want the group to be captured. This seems to
The reason this won't work is that when you write \1
you basically say "the content of the first group", which is of course undefined if the group is non-capturing.
As re.findall will always fetch a list of tuples once you define several capturing groups in the pattern, you can't use "regex-only" approach here.
Use re.finditer
to get all match data objects and get Group 2 contents from each match only:
print([x.group(2) for x in re.finditer(r'([A-Z]+)\1{2}(.)', s)])
See the Python demo