The method of vscode input regular expression to match
This article mainly introduces the vscode input regular expression matching method, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Vscode enters a regular expression to match:
Use the shortcut key "Ctrl+F" to bring up the search box
An example of a method for matching using regular expressions:
1) . - matches any character
Dot symbol. Used to match any character:
B.t
The above rule matches "bot", `"bat" and any three-character word that begins with b and ends with t. But if you want to search for a dot symbol, you need to escape it with\, so the following rule matches only the exact text "b.t":
B\ .t
2). * - matches anything
Here. It means "any character" and * means "this symbol repeats the previous content any number of times." Putting them together (. *) means "any symbol is repeated any number of times." For example, you can use it to find matches that begin or end with some text. Suppose we have a javascript method like this:
LoadScript (scriptName: string, pathToFile: string)
We want to find all calls to this method, where pathToFile points to any file in the folder "lua". You can use the following regular expressions:
LoadScript.*lua
This means that "matches all strings that start with" loadScript "and end with" lua ".
Thank you for reading this article carefully. I hope the article "vscode input regular expression matching method" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!