i

Python Programming

Match Object Methods & Description

group(num=0)

This method returns the entire match

groups()

It returns all matching subgroups in a tuple (empty if there weren't any)

Example

Output:

search.group() :  Cats are generally smarter than dogs

search.group(1) :  Cats

search.group(2) :  smarter