The official docs.
Flags
r.search(subject,re.I|
re.search(pattern,subject,re.I)
Match Objects
m = re.search(pattern,subject)
m.group(0) # whole match
m.group(1) # capture groups
m.start(), m.end() # location of match in subject
# so
left = subject[:m.start()]
mid = subject[m.start():m.end()]
right = subject[m.end():]
Findall
See the docs
re.findall(r'\bf[a-z]*', 'which foot or hand fell fastest')
['foot', 'fell', 'fastest']
re.findall(r'(\w+)=(\d+)', 'set width=20 and height=10')
[('width', '20'), ('height', '10')]