Don*_*onD 2 regex ide find visual-studio
我想使用相当于:
\<FooterTemplate.+?\<\/FooterTemplate\>/gms
Run Code Online (Sandbox Code Playgroud)
在Visual Studio 2015中
的html/asp标签及其内容的查找和替换正则表达式中.
上述正则表达式在VS中不起作用,但在regex101中起作用.
我用VS语法最接近的是:
\</*FooterTemplate[ ]*.*\>
Run Code Online (Sandbox Code Playgroud)
但只匹配标签外:
如何编辑上述正则表达式以在搜索时在标签之间包含内容?
在VS搜索和替换工具中,您可以使用[\r\s\S]字符类来匹配跨越多行的任何文本.
要匹配尽可能少的字符以获得有效匹配,您需要使用*?或+?延迟量词.
所以,你可以使用
<FooterTemplate[\r\s\S]+?</FooterTemplate>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1185 次 |
| 最近记录: |