我一直在試圖正則表達式找出輸出只有三個字母,並刪除單詞「不」正則表達式匹配三個字母和刪除三個字母
我試過到目前爲止是:
.gsub(/^[A-z]+$/)
(仍然輸出下同)
這是我需要regexed:
bash: line 1: drs: command not found
bash: line 2: tep: command not found
bash: line 3: ldo: command not found
bash: line 4: tep: command not found
bash: line 5: txw: command not found
bash: line 6: tep: command not found
bash: line 7: jfp: command not found
bash: line 8: mys: command not found
bash: line 9: jhf: command not found
bash: line 10: mjw: command not found
bash: line 11: czw: command not found
bash: line 12: txh: command not found
bash: line 13: krn: command not found
bash: line 14: sct: command not found
bash: line 15: jad: command not found
我希望它只是輸出:
drs
tep
ldo
tep
txw
tep
jfp
mys
jhf
mjw
czw
txh
krn
sct
jad
有沒有一種方法,我可以做到這一點?請記住我有多個其他三個字母組合,並帶有字母表中的所有字母。
總是在那個地方的信件?我的意思是,總是「bash:line xxxx:ABC:....」? – zon7
@ zon7是的,他們總是在同一個地方,我會編輯帖子掛在.. – Bam
請閱讀「[問]」和「[mcve]」。有沒有工作代碼?是否有樣本輸入和您的預期輸出? –