Extract match ids