Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

vscode settings - Multiline regular expression search in Visual Studio Code

Multiline regular expression search doesn't work in VS Code version 1.27.2 .

Theoretically aaa( |.)*bbb should find string starting from aaa and ending bbb but it doesn't work. The solution mentioned here Multi-line regular expressions in Visual Studio Code doesn't work as well.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Multiline search is added in v1.29 released in November 2018. See multi-line search.

VS Code now supports multiline search! Same as in the editor, a regex search executes in multiline mode only if it contains a literal. The Search view shows a hint next to each multiline match, with the number of additional match lines.

This feature is possible thanks to the work done in the ripgrep tool to implement multiline search.

multiline search: October 2018 release notes


Multiline search is coming to the Find Widget with v1.38. See multiline find "pre-release" notes.

Multi Line search in Find Widget

The Find Widget now supports multiple line text search and replace. By pressing Ctrl+Enter, you can insert new lines into the input box.

multiline find widget.

Odd that it is Ctrl+Enter in the Find Widget but Shift+Enter in the Search Panel (see Deepu's answer below). Shift+Enter has other functionality when the Find Widget is focused.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...