- 论坛徽章:
- 0
|
这样可以吗?- import re
- text='''
- Protocol Address Age (min) Hardware Addr Type Interface
- Internet 10.33.96.15 101 001b.21c7.a519 ARPA Vlan96Connection to 10.33.96.200 closed by remote host.
- Connection to 10.33.96.200 closed.
- Protocol Address Age (min) Hardware Addr Type Interface
- Internet 10.33.96.15 101 1234.21c7.abcd ARPA Vlan96Connection to 10.33.96.200 closed by remote host.
- Connection to 10.33.96.200 closed.
- '''
- pat='[0-9a-z]{4}\.[0-9a-z]{4}\.[0-9a-z]{4}'
- for match in re.findall(pat,text):
- print match
复制代码 |
|