From 6e987bcc8ed106800edf7f349b1e9e2914cd8872 Mon Sep 17 00:00:00 2001 From: Zyrouge Date: Sat, 26 Oct 2024 22:57:33 +0530 Subject: [PATCH] fix: replace symbols instead of non-alphanumeric (#528) --- app/src/main/java/io/github/zyrouge/symphony/utils/Fuzzy.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/zyrouge/symphony/utils/Fuzzy.kt b/app/src/main/java/io/github/zyrouge/symphony/utils/Fuzzy.kt index 737450a2..470bc794 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/utils/Fuzzy.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/utils/Fuzzy.kt @@ -59,9 +59,9 @@ object Fuzzy { normalizeTerms(against), ) + private val symbolsRegex = Regex("""[~${'$'}&+,:;=?@#|'"<>.^*()\[\]%!\-_/\\]+""") private val whitespaceRegex = Regex("""\s+""") - private val alphaNumericRegex = Regex("""[^A-Za-z0-9]""") private fun normalizeTerms(terms: String) = terms.lowercase() + .replace(symbolsRegex, "") .replace(whitespaceRegex, " ") - .replace(alphaNumericRegex, "") }