\b 单词边界

\bcool\b  只匹配cool字符串

[root@MongoDB ~]# cat test.txt 
i am mike1
i am mike
i am mike12

匹配有mike字符串的行

[root@MongoDB ~]# grep '\bmike\b' test.txt 
i am mike

 

相关文章:

  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-16
  • 2021-04-26
  • 2021-12-13
  • 2022-02-18
  • 2021-08-27
  • 2021-09-20
相关资源
相似解决方案