Search notes:

Python: re.Match

An instance of a re.Match object is returned by re.search() and re.match()
The boolean value of Match object is always True.
>>> import re
>>> m = re.search('(\d+)(?:_(\d+))(?:_(\d+))?(?:_(\d+))?(?:_(\d+))?','42_99_0')
>>> m.groups()
('42', '99', '0', None, None)
>>> m.group()
'42_99_0'
>>> m.group(1)
'42'
>>> m.group(2)
'99'
>>> m.lastindex
3

Index