linux 正则表达式 元字符

 

 

\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

 

posted @ 2019-06-01 16:57  minger_lcm  阅读(249)  评论(0编辑  收藏  举报