editor: fix search-replace regex

This commit is contained in:
ammarahm-ed
2023-06-23 12:09:50 +05:00
committed by Abdullah Atta
parent eb35d41321
commit fc10e957fb

View File

@@ -85,7 +85,7 @@ const regex = (s: string, settings: SearchSettings): RegExp => {
console.log(boundary);
return RegExp(
boundary +
(enableRegex ? s : s.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")) +
(enableRegex ? s : s.replace(/[/\\^$*+?.()|[\]]/g, "\\$&")) +
boundary,
matchCase ? "gu" : "gui"
);