grep 擷取任意字元的問題 - Linux

By Valerie
at 2018-09-07T23:20
at 2018-09-07T23:20
Table of Contents
不好意思
這問題 我找很久了 還是找不到
問題是這樣
假如我有一個文字檔
例如:
I wanna leave my footprints on the sands of time Know
there was something that, and something that I left behind
When I leave this world, I'll leave no regrets Leave something to remember,
我想找這行出來
there was something that, and something that I left behind
我下的方式是
cat txt | grep -o "there * that"
這邊* 我想要說可以是任意字串
但grep 任意字元 似乎不是用*
我google很久 有找到一個 \w*
可以表示任意一個字元
但這不符合我的需求
因為我不知道中間的任意字元會有幾個
請問有人有好方法嗎??
謝謝
--
這問題 我找很久了 還是找不到
問題是這樣
假如我有一個文字檔
例如:
I wanna leave my footprints on the sands of time Know
there was something that, and something that I left behind
When I leave this world, I'll leave no regrets Leave something to remember,
我想找這行出來
there was something that, and something that I left behind
我下的方式是
cat txt | grep -o "there * that"
這邊* 我想要說可以是任意字串
但grep 任意字元 似乎不是用*
我google很久 有找到一個 \w*
可以表示任意一個字元
但這不符合我的需求
因為我不知道中間的任意字元會有幾個
請問有人有好方法嗎??
謝謝
--
Tags:
Linux
All Comments

By Zenobia
at 2018-09-12T16:08
at 2018-09-12T16:08

By Joe
at 2018-09-17T14:35
at 2018-09-17T14:35

By Steve
at 2018-09-22T14:18
at 2018-09-22T14:18

By Connor
at 2018-09-26T02:54
at 2018-09-26T02:54

By Hedy
at 2018-09-28T21:10
at 2018-09-28T21:10
Related Posts
免驅動 晶片讀卡機

By Necoo
at 2018-09-06T22:37
at 2018-09-06T22:37
Ubuntu 連線 wifi 容易斷線

By Margaret
at 2018-09-06T15:12
at 2018-09-06T15:12
在多視窗跑不同指令 tmux 多視窗起始指令

By Annie
at 2018-09-06T13:24
at 2018-09-06T13:24
如何在ssh開啟的x window中輸入中文

By Jake
at 2018-09-06T01:54
at 2018-09-06T01:54
可上PTT的USB開機隨身碟

By Blanche
at 2018-09-05T16:11
at 2018-09-05T16:11