wrap im_match*() as a class