Skip to content

Commit d9e2f98

Browse files
committed
fix: allow exclamation in names
1 parent 0d69a4d commit d9e2f98

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: parse/parse.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ func isAbbreviation(str string) bool {
8686
return false
8787
}
8888

89-
var illegalcharsRegexp = regexp.MustCompile(`[^\p{L}0-9\s&'_\(\)\-,:]`)
89+
var illegalcharsRegexp = regexp.MustCompile(`[^\p{L}0-9\s&'_\(\)\-,:!]`)
9090
var spaceReplaceRegexp = regexp.MustCompile(`[\.\s_]+`)
9191
var websiteRegexp = regexp.MustCompile(`((https?|ftp|smtp):\/\/)?(www.)[a-z0-9]+\.[a-z]+(\/[a-zA-Z0-9#]+\/?)*`)
92-
var trimRegexp = regexp.MustCompile(`^[^\p{L}0-9]*(.+?[\.\)]?)[^\p{L}0-9]*$`)
92+
var trimRegexp = regexp.MustCompile(`^[^\p{L}0-9]*(.+?[\.\)]?)[^\p{L}0-9!]*$`)
9393

9494
// CleanName returns the media name cleaned from punctuation
9595
func CleanName(name string) string {

Diff for: parse/parse_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ var testMovieTitles = []string{
4444
"10 Things I Hate About You",
4545
"Berlin, I Love You",
4646
"To All the Boys I've Loved Before",
47+
"Mamma Mia!",
4748
}
4849

4950
func TestCleanNameMovieTitles(t *testing.T) {

0 commit comments

Comments
 (0)