之前在文章Python数据类型之字符串中介绍了split等分割字符串的方法,但是你会发现只能指定一个分隔符,那在Python下指定多个分隔符像AWK命令那样来分割字符串应该怎么做呢?...>>> info = "My host ip address is 10.0.1.10, hwaddress is 52:54:00:B7:7A:0A"
>>> import re
>>> re.split...host', 'ip', 'address', 'is', '10', '0', '1', '10', 'hwaddress', 'is', '52', '54', '00', 'B7', '7A', '0A...']
>>>
>>> info = "My host ip address is 10.0.1.10, hwaddress is 52:54:00:B7:7A:0A "
>>> re.split(r...host', 'ip', 'address', 'is', '10', '0', '1', '10', 'hwaddress', 'is', '52', '54', '00', 'B7', '7A', '0A