Multi-line regular expressions in Visual Studio Co

2019-01-23 15:29发布

问题:

I cannot figure a way to make regular expression match stop not on end of line, but on end of file in VS Code? Is it a tool limitation or there is some kind of pattern that I am not aware of?

回答1:

It seems the CR is not matched with [\s\S]. Add \r to this character class:

[\s\S\r]+

will match any 1+ chars.