我有这样的文件:
blue|1|red|2
green|3|blue|4
darkblue|0|yellow|3
我想使用 grep 来查找包含blue|
在行首或|blue|
任何地方的任何内容,但不是任何darkblue|
或|darkblue|
或|blueberry|
我尝试使用grep [^|\|]blue\|
,但 Git Bash 给了我错误:
$ grep [^|\|]blue\| *.*
grep: Unmatched [ or [^
sh.exe": |]blue|: command not found
我做错了什么?正确的方法是什么?