From 747fc4d6386e71ac7264b0d8d1c76a1cf89d6aaa Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 27 Aug 2020 23:13:08 +0300 Subject: [PATCH] Fix messages with only numbers and ascii characters not being normalized --- backend/src/utils/normalizeText.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/utils/normalizeText.ts b/backend/src/utils/normalizeText.ts index 2f65c366..d53fc240 100644 --- a/backend/src/utils/normalizeText.ts +++ b/backend/src/utils/normalizeText.ts @@ -150,7 +150,7 @@ const REPLACED_CHARS: Record = Array.from(Object.entries(REPLACE {}, ); -const NORMAL_CHARS_REGEX = /[\w2689:.-_+()*&^%><;"'}{~,]+/gim; +const NORMAL_CHARS_REGEX = /[a-z2689:.-_+()*&^%><;"'}{~,]+/gim; function containsOnlyNormalChars(text: string) { const match = text.match(NORMAL_CHARS_REGEX);