我如何使用 findstr windows 命令搜索不包括 xhtml 文件中注释的字符串/字符的字符串/字符?
例子:test.xml
<html>
<head/>
<body>
This is Test Code.
<!--Test Comment -->
</body>
</html>
findstr/X "测试"test.xml.
这将返回 2 行,而我只想打印未注释的行。 (预期输出::这是测试代码。)
最佳答案
findstr "Test" test.xtml |FINDSTR /v /r "<!.*>"
应该过滤掉注释行,但是您的 findstr/x
并不像您声称的那样行事。
关于windows - "findstr"Windows 命令排除评论中的搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24240212/