C:\demo.txt的内容如下:
this is bad
is bad enough
who's next
fair enough
C:\Users\Administrator>findstr /r "bad enough" C:\demo.txt
this is bad
is bad enough
fair enough
为什么都匹配出来了呢?“bad enough”这个明明只有第二行匹配才对啊
findstr /r "bad enough" C:\demo.txt
是把"bad"和"enough"作为两个搜索字符串,因为有空格
findstr /c:"bad enough" C:\demo.txt或是findstr /r "bad.enough" C:\demo.txt
就可以满足你的要求
是把"bad"和"enough"作为两个搜索字符串,因为有空格
findstr /c:"bad enough" C:\demo.txt或是findstr /r "bad.enough" C:\demo.txt
就可以满足你的要求
温馨提示:答案为网友推荐,仅供参考