Skip to content

Commit 3e18c49

Browse files
authored
Escape query, fixes microsoft#153583 (microsoft#154990)
1 parent 18d4405 commit 3e18c49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ export class SettingMatches {
554554
// Trim excess ending characters off the query.
555555
singleWordQuery = singleWordQuery.toLowerCase().replace(/[\s-\._]+$/, '');
556556
lineToSearch = lineToSearch.toLowerCase();
557-
const singleWordRegex = new RegExp(`\\b${singleWordQuery}\\b`);
557+
const singleWordRegex = new RegExp(`\\b${strings.escapeRegExpCharacters(singleWordQuery)}\\b`);
558558
if (singleWordRegex.test(lineToSearch)) {
559559
this.matchType |= SettingMatchType.WholeWordMatch;
560560
}

0 commit comments

Comments
 (0)