### Summary

Removing a wildcard package using a non-English locale produces a failure that is normally filtered out when `en_*` locale is set. This issue was originally tested against Ansible 2.9.27 on Alma 8. For the sake of thoroughness in this bug report, it's tested against devel. Error looks to be related to filtering in [ _sanitize_dnf_error_msg_remove](https://github.com/ansible/ansible/blob/7ec8916097a4c4281215c127c80ed07c5b0b370d/lib/ansible/modules/dnf.py#L422) method in dnf.py.

### Issue Type

Bug Report

### Component Name

dnf

### Ansible Version

```console
$ ansible --version


ansible [core 2.14.0.dev0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/ansible/build/lib/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = ./bin/ansible
  python version = 3.9.12 (05fbe3aa5b0845e6c37239768aa455451aa5faba, Mar 29 2022, 08:15:34)[PyPy 7.3.9 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] (/usr/local/share/python/pyenv/versions/pypy3.9-7.3.9/bin/python)
  jinja version = 3.1.2
  libyaml = True
```
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all


CONFIG_FILE() = /etc/ansible/ansible.cfg
```
```


### OS / Environment

Rocky Linux 8.6

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->

```bash
dnf install -y glibc-langpack-de
env LANGUAGE=de_DE PYTHONPATH=$(pwd)/build/lib ./bin/ansible -m dnf -a "name=foo* state=absent" localhost
```

### Expected Results

```bash
# env LANGUAGE=de_DE PYTHONPATH=$(pwd)/build/lib ./bin/ansible -m dnf -a "name=foo* state=absent" localhost

[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the
Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any
point.
localhost | SUCCESS => {
    "changed": false,
    "msg": "Nothing to do",
    "rc": 0,
    "results": [
        "foo* is not installed"
    ]
}
```

### Actual Results

```console
# env LANGUAGE=de_DE PYTHONPATH=$(pwd)/build/lib ./bin/ansible -m dnf -a "name=foo* state=absent" localhost

ansible [core 2.14.0.dev0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/ansible/build/lib/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = ./bin/ansible
  python version = 3.9.12 (05fbe3aa5b0845e6c37239768aa455451aa5faba, Mar 29 2022, 08:15:34)[PyPy 7.3.9 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] (/usr/local/share/python/pyenv/versions/pypy3.9-7.3.9/bin/python)
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /root/ansible/build/lib/ansible/plugins/callback/minimal.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
META: ran handlers
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042 `" && echo ansible-tmp-1656872847.309763-1625687-262384129527042="` echo /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042 `" ) && sleep 0'
Using module file /root/ansible/build/lib/ansible/modules/dnf.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1625641dm2mqnnl/tmpz76lr8y_ TO /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/AnsiballZ_dnf.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/ /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/AnsiballZ_dnf.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/local/share/python/pyenv/versions/pypy3.9-7.3.9/bin/python /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/AnsiballZ_dnf.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/ > /dev/null 2>&1 && sleep 0'
localhost | FAILED! => {
    "changed": false,
    "failures": [
        "foo* - Keine �bereinstimmung f�r Argumente: foo*"
    ],
    "invocation": {
        "module_args": {
            "allow_downgrade": false,
            "allowerasing": false,
            "autoremove": false,
            "bugfix": false,
            "cacheonly": false,
            "conf_file": null,
            "disable_excludes": null,
            "disable_gpg_check": false,
            "disable_plugin": [],
            "disablerepo": [],
            "download_dir": null,
            "download_only": false,
            "enable_plugin": [],
            "enablerepo": [],
            "exclude": [],
            "install_repoquery": true,
            "install_weak_deps": true,
            "installroot": "/",
            "list": null,
            "lock_timeout": 30,
            "name": [
                "foo*"
            ],
            "nobest": false,
            "releasever": null,
            "security": false,
            "skip_broken": false,
            "sslverify": true,
            "state": "absent",
            "update_cache": false,
            "update_only": false,
            "validate_certs": true
        }
    },
    "msg": "Failed to install some of the specified packages",
    "rc": 1,
    "results": []
}
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
if self.with_modules:
                    mdl = self.module_base._get_modules(grp_env_mdl_candidate)
                    if mdl[0]:
                        module_specs.append(grp_env_mdl_candidate)
                    else:
                        grp_specs.append(grp_env_mdl_candidate)
                else:
                    grp_specs.append(grp_env_mdl_candidate)
            else:
                pkg_specs.append(name)
        return pkg_specs, grp_specs, module_specs, filenames
    def _update_only(self, pkgs):
        not_installed = []
        for pkg in pkgs:
            if self._is_installed(pkg):
                try:
                    if isinstance(to_text(pkg), text_type):
                        self.base.upgrade(pkg)
                    else:
                        self.base.package_upgrade(pkg)
                except Exception as e:
                    self.module.fail_json(
                        msg="Error occurred attempting update_only operation: {0}".format(to_native(e)),
                        results=[],
                        rc=1,
                    )
            else:
                not_installed.append(pkg)
        return not_installed
    def _install_remote_rpms(self, filenames):