Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尝试编写正确的grep命令来搜索文件中出现的任何美元值,范围从$10.00到$99.99. 我主要关心的是$符号是否需要转义\。到目前为止我有这个
grep
$10.00
$99.99
$
\
grep '$[1-9][0-9]\.[0-9][0-9]' file
只是想知道是否应该
grep '\$[1-9][0-9]\.[0-9][0-9]' file
反而。
$ 和 . 由于 . 将需要逃生。作为贪婪的字符匹配器。