fspath: remove unused capture group in remote name regex

This commit is contained in:
albertony 2022-09-16 16:18:26 +02:00 committed by Nick Craig-Wood
parent 04a663829b
commit c571200812

View file

@ -14,7 +14,7 @@ import (
const ( const (
configNameRe = `[\w. -]+` configNameRe = `[\w. -]+`
remoteNameRe = `(:?` + configNameRe + `)` remoteNameRe = `:?` + configNameRe
) )
var ( var (
@ -35,7 +35,7 @@ var (
configNameMatcher = regexp.MustCompile(`^` + configNameRe + `$`) configNameMatcher = regexp.MustCompile(`^` + configNameRe + `$`)
// remoteNameMatcher is a pattern to match an rclone remote name at the start of a config // 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 // CheckConfigName returns an error if configName is invalid