Skip to content

Commit 8372344

Browse files
committed
Fix #35012 - allow ^\s*$ regex search
1 parent b6ecd78 commit 8372344

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/base/common/strings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export function createRegExp(searchString: string, isRegex: boolean, options: Re
221221
export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {
222222
// Exit early if it's one of these special cases which are meant to match
223223
// against an empty string
224-
if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$') {
224+
if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\s*$') {
225225
return false;
226226
}
227227

0 commit comments

Comments
 (0)