### Description

#27647 has introduced filtering for invalid schemas in Hive hook based on the characters `;` and `!`. I'm wondering if a more generic filtering could be introduced, e.g. one that adheres to the regex `[^a-z0-9_]`, since Hive schemas (and table names) can only contain alphanumeric characters and the character `_`.

Note: since the Hive metastore [stores schemas and tables in lowercase](https://stackoverflow.com/questions/57181316/how-to-keep-column-names-in-camel-case-in-hive/57183048#57183048), checking against `[^a-z0-9_]` is probably better than `[^a-zA-Z0-9_]`.

### Use case/motivation

Ensure that Hive schemas used in `apache-airflow-providers-apache-hive` hooks contain no invalid characters.

### Related issues

_No response_

### Are you willing to submit a PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

with mock.patch(
            "airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook._find_valid_host"
        ) as find_valid_host, mock.patch(
            "airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook.get_connection"
        ) as get_connection:
            find_valid_host.return_value = mock.MagicMock(return_value="")
            get_connection.return_value = mock.MagicMock(return_value="")
            metastore_hook = HiveMetastoreHook()
        assert isinstance(metastore_hook.get_conn(), HMSClient)
    def test_check_for_partition(self):
        
        FakePartition = namedtuple("FakePartition", ["values"])
        fake_partition = FakePartition(["2015-01-01"])
        metastore = self.hook.metastore.__enter__()
        partition = f"{self.partition_by}='{DEFAULT_DATE_DS}'"
        metastore.get_partitions_by_filter = mock.MagicMock(return_value=[fake_partition])
        assert self.hook.check_for_partition(self.database, self.table, partition)
        metastore.get_partitions_by_filter(
            self.database, self.table, partition, HiveMetastoreHook.MAX_PART_COUNT
        )
        
        missing_partition = f"{self.partition_by}='{self.next_day}'"
        metastore.get_partitions_by_filter = mock.MagicMock(return_value=[])
        assert not self.hook.check_for_partition(self.database, self.table, missing_partition)
        metastore.get_partitions_by_filter.assert_called_with(
            self.database, self.table, missing_partition, HiveMetastoreHook.MAX_PART_COUNT
        )
    def test_check_for_named_partition(self):