让我们从一个例子开始。我想找到整个解决方案中所有以词组template
开头并以.js
结尾的地方。
例如
匹配:
template\blah\loadprojdata.js
template\scripts\showhidecontrols.js
template\scripts\pageloader.js
template\scripts\andsearchfield.js
不匹配:
template\scripts\pageloader.css
\template\scripts\andsearchfield.js
对于所有出现的事件,我想在开头添加一个\符号,以便预期结果如下:
\template\blah\loadprojdata.js
\template\scripts\showhidecontrols.js
\template\scripts\pageloader.js
\template\scripts\andsearchfield.js
到目前为止,我已经创建了一个表达式
^template.*\.js$
但是我不知道如何将\
添加到找到的每一行的开头。我在VS代码中只有“替换”选项。有任何想法吗?
干杯