mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 21:52:24 +00:00
'u' flag makes RegExp stricter about which characters can be escaped
Fix #80455
This commit is contained in:
parent
bc9a46a307
commit
4f87889a7f
2 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ export function escape(html: string): string {
|
|||
* Escapes regular expression characters in a given string
|
||||
*/
|
||||
export function escapeRegExpCharacters(value: string): string {
|
||||
return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g, '\\$&');
|
||||
return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, '\\$&');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -426,7 +426,7 @@ export class SearchWidget extends Widget {
|
|||
}
|
||||
try {
|
||||
// tslint:disable-next-line: no-unused-expression
|
||||
new RegExp(value);
|
||||
new RegExp(value, 'u');
|
||||
} catch (e) {
|
||||
return { content: e.message };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue