Used by Zarf to swap the registry domain/port part an image url without needed the docker libraries. usage in go:
func SwapHost(src string, targetHost string) string {
var parser = regexp.MustCompile(`(?im)^([a-z0-9\-.]+\.[a-z0-9\-]+:?[0-9]*)?/?(.+)$`)
var substitution = targetHost + "/$2"
return parser.ReplaceAllString(src, substitution)
}