提交 8816e58c 编写于 作者: R Rob Lourens

Fix #66467 - don't restrict .* regex in search

上级 70f3ce5d
......@@ -1143,20 +1143,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
return;
}
// Validate regex is OK
if (isRegex) {
let regExp: RegExp;
try {
regExp = new RegExp(contentPattern);
} catch (e) {
return; // malformed regex
}
if (strings.regExpLeadsToEndlessLoop(regExp)) {
return; // endless regex
}
}
const content: IPatternInfo = {
pattern: contentPattern,
isRegExp: isRegex,
......
......@@ -397,15 +397,12 @@ export class SearchWidget extends Widget {
if (!this.searchInput.getRegex()) {
return null;
}
let regExp: RegExp;
try {
regExp = new RegExp(value);
// tslint:disable-next-line: no-unused-expression
new RegExp(value);
} catch (e) {
return { content: e.message };
}
if (strings.regExpLeadsToEndlessLoop(regExp)) {
return { content: nls.localize('regexp.validationFailure', "Expression matches everything") };
}
if (strings.regExpContainsBackreference(value)) {
if (!this.searchConfiguration.usePCRE2) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册