大家好,
有一份文件(https://goo.gl/2Vc3Ui):
146460673
PING 10.0.0.6 (10.0.0.6): 56 data bytes
想要把146460673及56抓出来,
自己试过下列的regular expression:
cat short_measurement_PING.txt | sed -r 's/([0-9]+).*PING.*([0-9]+) data bytes/\1 \2/g'
cat short_measurement_PING.txt | sed -r 's/([0-9]+)$.*PING.*([0-9]+) data bytes/\1 \2/g'
cat short_measurement_PING.txt | sed -r 's/^([0-9]+)$^.*PING.*([0-9]+) data bytes/\1 \2/g'
不过完全没作用,
想请问大家有什么建议吗?
谢谢~
※ 编辑: decken (212.201.78.21), 06/01/2016 06:10:26