diff --git a/winrm/__init__.py b/winrm/__init__.py index ee40fa9b..c72c215e 100644 --- a/winrm/__init__.py +++ b/winrm/__init__.py @@ -94,7 +94,7 @@ def strip_namespace(self, xml): @staticmethod def _build_url(target, transport): match = re.match( - '(?i)^((?Phttp[s]?)://)?(?P[0-9a-z-_.]+)(:(?P\d+))?(?P(/)?(wsman)?)?', target) # NOQA + '(?i)^((?Phttp[s]?)://)?(?P\[[0-9A-Fa-f:]+]|[0-9a-z-_.]+)(:(?P\d+))?(?P(/)?(wsman)?)?', target) # NOQA scheme = match.group('scheme') if not scheme: # TODO do we have anything other than HTTP/HTTPS