求助大神,初学re
我的一个文件里的内容ProtocolAddress Age (min)Hardware Addr Type Interface
Internet10.33.96.15 101 001b.21c7.a519ARPA Vlan96Connection to 10.33.96.200 closed by remote host.
Connection to 10.33.96.200 closed.
现在需要把mac地址扣出来,求大神指点,谢谢
快沉了,求大神 :'( 这样可以吗?import re
text='''
ProtocolAddress Age (min)Hardware Addr Type Interface
Internet10.33.96.15 101 001b.21c7.a519ARPA Vlan96Connection to 10.33.96.200 closed by remote host.
Connection to 10.33.96.200 closed.
ProtocolAddress Age (min)Hardware Addr Type Interface
Internet10.33.96.15 101 1234.21c7.abcdARPA Vlan96Connection to 10.33.96.200 closed by remote host.
Connection to 10.33.96.200 closed.
'''
pat='{4}\.{4}\.{4}'
for match in re.findall(pat,text):
print match 回复 3# whitelotus19
大神就是大神,灰常谢谢.
页:
[1]