### 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)

self.hook.metastore.__enter__().get_table = mock.MagicMock(return_value=True)
        assert self.hook.table_exists(self.table, db=self.database)
        self.hook.metastore.__enter__().get_table.assert_called_with(
            dbname="airflow", tbl_name="static_babynames_partitioned"
        )
        
        self.hook.metastore.__enter__().get_table = mock.MagicMock(side_effect=Exception())
        assert not self.hook.table_exists("does-not-exist")
        self.hook.metastore.__enter__().get_table.assert_called_with(
            dbname="default", tbl_name="does-not-exist"
        )
    @mock.patch("airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook.table_exists")
    @mock.patch("airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook.get_metastore_client")
    def test_drop_partition(self, get_metastore_client_mock, table_exist_mock):
        metastore_mock = get_metastore_client_mock.return_value
        table_exist_mock.return_value = True
        ret = self.hook.drop_partitions(self.table, db=self.database, part_vals=[DEFAULT_DATE_DS])
        table_exist_mock.assert_called_once_with(self.table, self.database)
        assert metastore_mock.drop_partition(self.table, db=self.database, part_vals=[DEFAULT_DATE_DS]), ret
class TestHiveServer2Hook(unittest.TestCase):