Update get_matching_groups to allow for custom $rule_types array lookups