diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index 08f7a9ea..7713e1e0 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -161,8 +161,8 @@ class EntryPoint(DeprecatedTuple): pattern = re.compile( r'(?P[\w.]+)\s*' - r'(:\s*(?P[\w.]+))?\s*' - r'(?P\[.*\])?\s*$' + r'(:\s*(?P[\w.]+)\s*)?' + r'((?P\[.*\])\s*)?$' ) """ A regular expression describing the syntax for an entry point,