小编Ill*_*Guy的帖子

Grep特定长度的字符

假设我有一个文件foo.txt,其中包含某些内容:

abcds9912:        8c b2           1e12
asddb221          jj 7u 9i         e2e1
Run Code Online (Sandbox Code Playgroud)

现在我想grep8c, b2, jj, 7u, 9i 即字符成对未来

到目前为止,我已经尝试过

cat foo.txt | grep -Eo '[a-z0-9]{2}'
Run Code Online (Sandbox Code Playgroud)

但这没用

regex linux bash shell grep

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

标签 统计

bash ×1

grep ×1

linux ×1

regex ×1

shell ×1