Hi
I have the output below stored in a variable called outping. I am trying to pick the values in bold into two variables using python regular expressions. i will appreciate your help. Thanks
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.1.8, timeout is 2 seconds:
!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!
!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/3/12 ms
switch1B#
Here is the code i am trying to use
I have the output below stored in a variable called outping. I am trying to pick the values in bold into two variables using python regular expressions. i will appreciate your help. Thanks
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.1.8, timeout is 2 seconds:
!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!
!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/3/12 ms
switch1B#
Here is the code i am trying to use
Code:
patt = re.compile(r"(Success rate)", re.MULTILINE) m = re.search(patt, outping) print m.group(1)
Comment