小编sup*_*rme的帖子

在单独的行或单行上的模式之间进行 Grep

所以我需要的是 grep 仅匹配我的匹配模式之间(并包括)之间的文本。

像这样的东西(不要介意文字,这只是一些乱码:D):

asdgfasd gasd gdas g This will be this one day ksjadnbalsdkbgas asd gasdg 
asdgasdgasdg dasg dasg dasg This will be this next day adf gdsf gdsf sdfh dsfhdfsh
asdf asdf asd fesf dsfasd f This will won' not this day asdgadsgaseg as dvf as d vfa se v asd
dasfasdfdas fase fasdfasefase fasdf This not what shoes day asdjbna;sdgbva;sdkbcvd;lasb ;lkbasi hasdli glais g
Run Code Online (Sandbox Code Playgroud)

所以我想要的是这样的: cat theabovetext|grep -E "^This * day$" 输出:

This will be this one …
Run Code Online (Sandbox Code Playgroud)

grep wildcards

3
推荐指数
1
解决办法
1443
查看次数

标签 统计

grep ×1

wildcards ×1