m = re.search('pattern', str)
if m:
  item = m.group(1)

みたいには書けるけど、ifの中にmの取得を一緒に書けない?
そうでないと、if elif elseで書けない