More work on porting diff kitten

This commit is contained in:
Kovid Goyal
2023-03-19 17:17:41 +05:30
parent ee82cb5a52
commit 5d8b5ab720
5 changed files with 210 additions and 8 deletions

View File

@@ -146,7 +146,7 @@ func Memset[T any](dest []T, pattern ...T) []T {
}
var ControlCodesPat = (&Once[*regexp.Regexp]{Run: func() *regexp.Regexp {
return regexp.MustCompile("[\x00-\x09\x0b-\x1f\x7f\x80-\x9f]")
return regexp.MustCompile("[\x00-\x09\x0b-\x1f\x7f\u0080-\u009f]")
}}).Get
func SanitizeControlCodes(raw string, replace_with ...string) string {