|
匹配任意字母,后跟任意字母的0次或多次重复,并以i n g结尾,模式为/ . * i n g /。可以使用这个模式查询以i n g结尾的任意单词。
[root@localhost test]# cat quote.txt
The honeysuckle band played all night long for only $90.
It was an evening of splendid music and company.
Too bad the disco floor fell through at 23:10.
The local nurse Miss P.Neave was in attendance.
[root@localhost test]# sed -n '/*ing/'p quote.txt
[root@localhost test]# sed -n '/.*ing/'p quote.txt
It was an evening of splendid music and company.
[root@localhost test]#
以上的sed中的/*ing/和/.*ing/有啥区别,我觉得*ing应该是包含.*ing的,按照正则表达式的说明,点是匹配一个字符的,*匹配任何字符,但从上面例子来看,我的理解是错误的,但不知错在哪里,请教。 |
|