This commit is contained in:
nisdas
2022-08-03 09:45:23 +08:00
parent bfbf220c79
commit f9a33e5827

View File

@@ -321,7 +321,7 @@ func (f *TextFormatter) needsQuoting(text string) bool {
func extractPrefix(msg string) (string, string) {
prefix := ""
regex := regexp.MustCompile("^\\[(.*?)\\]")
regex := regexp.MustCompile(`^\\[(.*?)\\]`)
if regex.MatchString(msg) {
match := regex.FindString(msg)
prefix, msg = match[1:len(match)-1], strings.TrimSpace(msg[len(match):])