From d240b035497a54331415c5aff5c02b1aa45c09a9 Mon Sep 17 00:00:00 2001 From: Zabil Cheriya Maliackal Date: Thu, 22 Aug 2024 18:39:01 +0100 Subject: [PATCH] Remove control characters from regex Signed-off-by: Zabil Cheriya Maliackal --- lib/repl/repl-search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/repl/repl-search.js b/lib/repl/repl-search.js index 84885f65a..00fd7d42f 100644 --- a/lib/repl/repl-search.js +++ b/lib/repl/repl-search.js @@ -47,7 +47,8 @@ function isCtrlR(k) { } function isControlChar(c) { - return /[\x00-\x1F]/.test(c); + const code = c.charCodeAt(0); + return code >= 0 && code <= 31; } function search(query, repl, next) {