I was trying to detect incorrectly (over-)intended code like that
foo {
bar {
baz {
with regular expressions and I found an interesting behavior.
The regex I'm using is /^( *).+\n\1 {3,}/
and in VS Code (standard find&replace dialog) it triggers false-positives on everything. At the same time in JavaScript (Chrome 74) there's no such behavior.
The stricter regex /^( *)\S.+\n\1 {3,}/
works correctly, but I wonder why does the difference exist? Is it that in JavaScript does not backtrack after line break (this is my wild guess) or does VS Code handle whitespace characters specifically making e.g. matching them ungreedy by default?
PS: IE works the same way as Chrome.