From 14acfd4476809cc6dc9894c27ac6f03e7972ebc4 Mon Sep 17 00:00:00 2001 From: Matthieu Pignolet Date: Fri, 21 Jun 2024 18:03:36 +0400 Subject: [PATCH] fix regexes --- discordjs/src/index.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discordjs/src/index.mjs b/discordjs/src/index.mjs index 63a5a1e..6021b0c 100644 --- a/discordjs/src/index.mjs +++ b/discordjs/src/index.mjs @@ -32,9 +32,9 @@ const sanitizeWord = (sentence) => { .trim() .split(" ") .slice(-1)[0] - .replaceAll(/(?>\?|\!|\.|\,|\;)/g, "") + .replaceAll(/(\?|\!|\.|\,|\;)/g, "") .replaceAll(/(\s)?([^\x41-\x5A\s^\x61-\x7A^\xC0-\xFF])/g, "") - .replaceAll(/\<(?>[a-z]|[A-Z])+\:(?>[a-z]|[A-Z])+\:[0-9]+\>/g,) + .replaceAll(/\<([a-z]|[A-Z])+\:([a-z]|[A-Z])+\:[0-9]+\>/g, "") .replaceAll(/(?:https?|ftp):\/\/[\n\S]+/g, ''); return lastWord; }; -- 2.39.5