(input string, scope string)
| 9 | ) |
| 10 | |
| 11 | func ReplaceHostPrefix(input string, scope string) string { |
| 12 | input = strings.ReplaceAll(input, "\\", "/") |
| 13 | pattern := regexp.MustCompile(fmt.Sprintf(`(^|\/)%s(\/|$)`, config.Config.Folder+scope)) |
| 14 | |
| 15 | if pattern.MatchString(input) { |
| 16 | return pattern.ReplaceAllString(input, "${1}./") |
| 17 | } |
| 18 | return input |
| 19 | } |