Get all capture groups from regex match in Python

match.groups()

Example

match = re.match(r"(\d+)(\w+)", "123abc")
print(match.groups())

Output: ('123', 'abc')

Prerequisite

import re

Reference

re — Regular expression operations — Python 3.12.2 documentation