no
raining now
go to school and play with code 你.
findstr "\<go code\>"
這樣就能匹配輸出包含go到code的文本了
看起來丑,其實也就是\斜線加尖括號 (轉義而已)
echo "go to school and play with code 你." | findstr "\<go code\>" 結果: "go to school and play with code 你."
但是這樣也行,我就懵了
echo "go to school and play with code 你." | findstr "\<code go\>" "go to school and play with code 你."
還有這樣
echo "go to school and play with code 你." | findstr "\<code\> \<go\>" "go to school and play with code 你."
而這最后這種情況有個強大的bug,
它有時搭配dir時只輸出包含中文的內容,我的是win10預覽版,正式版怎么樣不清楚,氣死我了,難怪windows在命令行領域干不過Linux
出bug的命令[一臉懵逼]
所以這玩意到底是怎么用的
附上從不知道哪里復制過來的,侵權請聯系我
利用元字符查找。 \<xyz 字位置: 字的開始 xyz\> 字位置: 字的結束
|