diff --git a/shtab/__init__.py b/shtab/__init__.py
index a34c474..b751284 100644
--- a/shtab/__init__.py
+++ b/shtab/__init__.py
@@ -129,8 +129,8 @@ def complete2pattern(opt_complete, shell: str, choice_type2fn) -> str:
 
 
 def wordify(string: str) -> str:
-    """Replace non-word chars [-. :] with underscores [_]"""
-    return re.sub(r"[-.\s:]", "_", string)
+    """Replace non-word chars [\\W] with underscores [_]"""
+    return re.sub("\\W", "_", string)
 
 
 def get_public_subcommands(sub):

diff --git a/tests/test_shtab.py b/tests/test_shtab.py
index de23513..05ce08c 100644
--- a/tests/test_shtab.py
+++ b/tests/test_shtab.py
@@ -241,6 +241,25 @@ def test_subparser_colons(shell, caplog):
     assert not caplog.record_tuples
 
 
+@fix_shell
+def test_subparser_slashes(shell, caplog):
+    parser = ArgumentParser(prog="test")
+    subparsers = parser.add_subparsers()
+    subparsers.add_parser("sub/cmd", help="help message")
+    with caplog.at_level(logging.INFO):
+        completion = shtab.complete(parser, shell=shell)
+    print(completion)
+
+    if shell == "bash":
+        shell = Bash(completion)
+        shell.compgen('-W "${_shtab_test_subparsers[*]}"', "s", "sub/cmd")
+        shell.compgen('-W "${_shtab_test_pos_0_choices[*]}"', "s", "sub/cmd")
+        shell.test('-z "${_shtab_test_COMPGEN-}"')
+    elif shell == "zsh":
+        assert "_shtab_test_sub/cmd" not in completion
+        assert "_shtab_test_sub_cmd" in completion
+
+
 @fix_shell
 def test_add_argument_to_optional(shell, caplog):
     parser = ArgumentParser(prog="test")

Could replace more non-word characters
I have an argparse script which accepts subcommands with names like:

```
my/first/subcommand
my/second/subcommand
```

which end up causing invalid completion scripts similar to #20.

It would be trivial to add `/` to the list of characters replaced in `wordify()`, or even change the character set to `\W` to replace any non-word character. Are either of these options preferable? (both work when tested with my script)

I'm happy to put together a one-line pull request if you think this is worthwhile.
tests/test_shtab.py::test_subparser_slashes[bash] tests/test_shtab.py::test_subparser_slashes[zsh]
tests/test_shtab.py::test_bash[export tests/test_shtab.py::test_bash[--z tests/test_shtab.py::test_bash_compgen tests/test_shtab.py::test_choices tests/test_shtab.py::test_main[bash] tests/test_shtab.py::test_main[zsh] tests/test_shtab.py::test_main[tcsh] tests/test_shtab.py::test_main_self_completion[bash] tests/test_shtab.py::test_main_self_completion[zsh] tests/test_shtab.py::test_main_self_completion[tcsh] tests/test_shtab.py::test_prog_override[bash] tests/test_shtab.py::test_prog_override[zsh] tests/test_shtab.py::test_prog_override[tcsh] tests/test_shtab.py::test_prog_scripts[bash] tests/test_shtab.py::test_prog_scripts[zsh] tests/test_shtab.py::test_prog_scripts[tcsh] tests/test_shtab.py::test_prefix_override[bash] tests/test_shtab.py::test_prefix_override[zsh] tests/test_shtab.py::test_prefix_override[tcsh] tests/test_shtab.py::test_complete[bash] tests/test_shtab.py::test_complete[zsh] tests/test_shtab.py::test_complete[tcsh] tests/test_shtab.py::test_positional_choices[bash] tests/test_shtab.py::test_positional_choices[zsh] tests/test_shtab.py::test_positional_choices[tcsh] tests/test_shtab.py::test_custom_complete[bash] tests/test_shtab.py::test_custom_complete[zsh] tests/test_shtab.py::test_custom_complete[tcsh] tests/test_shtab.py::test_subparser_custom_complete[bash] tests/test_shtab.py::test_subparser_custom_complete[zsh] tests/test_shtab.py::test_subparser_custom_complete[tcsh] tests/test_shtab.py::test_subparser_aliases[bash] tests/test_shtab.py::test_subparser_aliases[zsh] tests/test_shtab.py::test_subparser_aliases[tcsh] tests/test_shtab.py::test_subparser_colons[bash] tests/test_shtab.py::test_subparser_colons[zsh] tests/test_shtab.py::test_subparser_colons[tcsh] tests/test_shtab.py::test_subparser_slashes[tcsh] tests/test_shtab.py::test_add_argument_to_optional[bash] tests/test_shtab.py::test_add_argument_to_optional[zsh] tests/test_shtab.py::test_add_argument_to_optional[tcsh] tests/test_shtab.py::test_add_argument_to_positional[bash] tests/test_shtab.py::test_add_argument_to_positional[zsh] tests/test_shtab.py::test_add_argument_to_positional[tcsh] tests/test_shtab.py::test_get_completer[bash] tests/test_shtab.py::test_get_completer[zsh] tests/test_shtab.py::test_get_completer[tcsh] tests/test_shtab.py::test_get_completer_invalid