cfg: New function cfg_get_matches().