Skip to content

Commit

Permalink
Remove control characters from regex
Browse files Browse the repository at this point in the history
Signed-off-by: Zabil Cheriya Maliackal <[email protected]>
  • Loading branch information
zabil committed Aug 22, 2024
1 parent f131672 commit d240b03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/repl/repl-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d240b03

Please sign in to comment.