srpmproc/pkg/misc/regex.go

15 lines
432 B
Go
Raw Normal View History

package misc
import (
"fmt"
"regexp"
)
func GetTagImportRegex(importBranchPrefix string, allowStreamBranches bool) *regexp.Regexp {
if allowStreamBranches {
return regexp.MustCompile(fmt.Sprintf("refs/tags/(imports/(%s(?:.s|.)|%s(?:|s).+)/(.*))", importBranchPrefix, importBranchPrefix))
} else {
return regexp.MustCompile(fmt.Sprintf("refs/tags/(imports/(%s.|%s.-.+)/(.*))", importBranchPrefix, importBranchPrefix))
}
}