From c571200812133e79d7d0e833cfa46a8fa7a2b9d9 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Fri, 16 Sep 2022 16:18:26 +0200 Subject: [PATCH] fspath: remove unused capture group in remote name regex --- fs/fspath/path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fspath/path.go b/fs/fspath/path.go index 7943894c5..810189a07 100644 --- a/fs/fspath/path.go +++ b/fs/fspath/path.go @@ -14,7 +14,7 @@ import ( const ( configNameRe = `[\w. -]+` - remoteNameRe = `(:?` + configNameRe + `)` + remoteNameRe = `:?` + configNameRe ) var ( @@ -35,7 +35,7 @@ var ( configNameMatcher = regexp.MustCompile(`^` + configNameRe + `$`) // remoteNameMatcher is a pattern to match an rclone remote name at the start of a config - remoteNameMatcher = regexp.MustCompile(`^` + remoteNameRe + `(:$|,)`) + remoteNameMatcher = regexp.MustCompile(`^` + remoteNameRe + `(?::$|,)`) ) // CheckConfigName returns an error if configName is invalid