|
|
发表于 2019-4-28 22:05:53
|
显示全部楼层
- # coding: utf-8
- import re,os
- if __name__=="__main__":
- s='''16:45:53.244684 00:0c:29:5d:01:63 > 00:18:82:c7:cb:aa, ethertype IPv4 (0x0800), length 98: 134.168.122.240 > 134.168.122.129: ICMP echo request, id 42882, seq 225, length 64
- 0x0000: 4500 0054 11f2 4000 4001 c318 ac16 86f0 E..T..@.@.......
- 0x0010: ac16 8681 0800 de48 a782 00e1 4168 c55c .......H....Ah.\
- 0x0020: 0000 0000 a8bb 0300 0000 0000 1011 1213 ................
- 0x0030: 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223 .............!"#
- 0x0040: 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233 $%&'()*+,-./0123
- 0x0050: 3435 3637 4567'''
-
- text=re.sub("0x\d\d\d\d",'',s)
- t=re.sub("\d\d:\d\d:\d\d.*?length 64",'',text)
- print(t)
复制代码 |
|