diff --git a/src/borg/helpers/parseformat.py b/src/borg/helpers/parseformat.py index f595c8d39..39be4a544 100644 --- a/src/borg/helpers/parseformat.py +++ b/src/borg/helpers/parseformat.py @@ -355,10 +355,14 @@ class Location: # note: scp_re is also use for local paths scp_re = re.compile(r""" ( - """ + optional_user_re + r""" # user@ (optional) - (?P([^:/]+|\[[0-9a-fA-F:.]+\])): # host: (don't match / or [ipv6] in host to disambiguate from file:) - )? # user@host: part is optional - """ + scp_path_re + optional_archive_re, re.VERBOSE) # path with optional archive + """ + optional_user_re + r""" # user@ (optional) + (?P( # host can be ipv6 addr in brackets or something else + (?!\[)[^:/]+(?