From 98692a8d62f9c2f6fa5b57d90473e5092f6ae7e5 Mon Sep 17 00:00:00 2001 From: Navy Date: Wed, 9 Jun 2021 14:17:43 +0300 Subject: [PATCH] allow some regex chars --- util/Util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/Util.js b/util/Util.js index 82320ae..e8f3367 100644 --- a/util/Util.js +++ b/util/Util.js @@ -128,7 +128,7 @@ class Util { * @return {string} The sanitised expression * @memberof Util */ - static sanitiseRegex(input, allowed = ['?', '\\', '(', ')', '|']) { + static sanitiseRegex(input, allowed = ['?', '\\', '(', ')', '|', '\\[', '\\]', '.']) { if (!input) throw new Error('Missing input'); const reg = new RegExp(`[${this.regChars.filter((char) => !allowed.includes(char)).join('')}]`, 'gu'); return input.replace(reg, '\\$&');