Ignore brackets in search

This commit is contained in:
Deluan 2020-05-25 11:05:30 -04:00
parent 72e92c7318
commit aaa4f1531e
2 changed files with 5 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import (
"github.com/kennygrant/sanitize"
)
var quotesRegex = regexp.MustCompile("[“”‘’'\"]")
var quotesRegex = regexp.MustCompile("[“”‘’'\"\\[\\(\\{\\]\\)\\}]")
func getFullText(text ...string) string {
fullText := sanitizeStrings(text...)

View File

@ -26,5 +26,9 @@ var _ = Describe("sqlRepository", func() {
It("remove symbols", func() {
Expect(getFullText("Toms Diner ' “40” A")).To(Equal(" 40 a diner toms"))
})
It("remove opening brackets", func() {
Expect(getFullText("[Five Years]")).To(Equal(" five years"))
})
})
})