The group() method is a function in Python's re module that returns one or more matched subgroups of a regex match object. It is super handy for extracting different parts of a text.
For instance, the following code shows how to extract the two parts of a time string in the format of “HH:MM”: