From 8372344d76f67089e1fa5356e886dd5bf4606d7b Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 26 Sep 2017 10:30:50 -0700 Subject: [PATCH] Fix #35012 - allow ^\s*$ regex search --- src/vs/base/common/strings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/common/strings.ts b/src/vs/base/common/strings.ts index 2200f4e5721..449fadff2dd 100644 --- a/src/vs/base/common/strings.ts +++ b/src/vs/base/common/strings.ts @@ -221,7 +221,7 @@ export function createRegExp(searchString: string, isRegex: boolean, options: Re export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean { // Exit early if it's one of these special cases which are meant to match // against an empty string - if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$') { + if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\s*$') { return false; } -- GitLab