def _is_regex(self, pattern: str) -> bool:
        """Check if a string is a regex pattern."""
        try:
            re.compile(pattern)
            return True
        except re.error:
            return False
Check if a string is a regex pattern.
llama-index-integrations/readers/llama-index-readers-slack/llama_index/readers/slack/base.py