diff --git a/internal/processor/title.go b/internal/processor/title.go index da2d438..0024615 100644 --- a/internal/processor/title.go +++ b/internal/processor/title.go @@ -19,7 +19,9 @@ func processTitle(title string, matchRelease bool) []string { t := NewTitleSlice() // Regex patterns - replaceRegexp := regexp.MustCompile(`[[:punct:]\s\x{00a0}\x{2000}-\x{200f}\x{2026}-\x{202f}\x{205f}-\x{206f}à-üÀ-Ü]`) + // https://www.regular-expressions.info/unicode.html#category + // https://www.ncbi.nlm.nih.gov/staff/beck/charents/hex.html + replaceRegexp := regexp.MustCompile(`[\p{P}\p{Z}\x{00C0}-\x{017E}]`) questionmarkRegexp := regexp.MustCompile(`[?]{2,}`) regionCodeRegexp := regexp.MustCompile(`\(.+\)$`) parenthesesEndRegexp := regexp.MustCompile(`\)$`) diff --git a/internal/processor/title_test.go b/internal/processor/title_test.go index eb5389c..01f6463 100644 --- a/internal/processor/title_test.go +++ b/internal/processor/title_test.go @@ -208,6 +208,14 @@ func Test_processTitle(t *testing.T) { }, want: []string{"What?If", "What?If*"}, }, + { + name: "test_25", + args: args{ + title: "Shōgun (2024)", + matchRelease: false, + }, + want: []string{"Sh?gun*2024?", "Sh?gun*2024", "Sh?gun"}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {