def _filter_channels(
        self, channels: List[Dict[str, Any]], patterns: List[str]
    ) -> List[Dict[str, Any]]:
        """Filter channels based on the provided names and regex patterns."""
        regex_patterns = [pattern for pattern in patterns if self._is_regex(pattern)]
        exact_names = [pattern for pattern in patterns if not self._is_regex(pattern)]

        # Match Exact Channel names
        filtered_channels = [
            channel for channel in channels if channel["name"] in exact_names
        ]

        # Match Regex Patterns
        for channel in channels:
            for pattern in regex_patterns:
                if re.match(pattern, channel["name"]):
                    filtered_channels.append(channel)
        return filtered_channels
Filter channels based on the provided names and regex patterns.
llama-index-integrations/readers/llama-index-readers-slack/llama_index/readers/slack/base.py