diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py
index 25ca0b4f0..c957c7da6 100644
--- a/IPython/frontend/html/notebook/notebookapp.py
+++ b/IPython/frontend/html/notebook/notebookapp.py
@@ -75,7 +75,7 @@ from IPython.utils import py3compat
_kernel_id_regex = r"(?P\w+-\w+-\w+-\w+-\w+)"
_kernel_action_regex = r"(?Prestart|interrupt)"
_notebook_id_regex = r"(?P\w+-\w+-\w+-\w+-\w+)"
-_profile_regex = r"(?P[a-zA-Z0-9]+)"
+_profile_regex = r"(?P[^\/]+)" # there is almost no text that is invalid
_cluster_action_regex = r"(?Pstart|stop)"