some re methods return re matchobject contain captured groups re_groups py text adm : : st graf :home adm :bin bash grp re match ^( - ]+) :[ - ]+:[ - ]+:+)+text if grp )print found grp groups ()print user id grp group ( )print name grp group ( )python re_groups py found adm st graf 'user id adm name st graf member of the helmholtz association slide