I am trying to go through a string that looks like this:
Device ID: ArouterName
Entry address(es):
IP address: 1.4.2.3
Platform: cisco WS-C2924-XL, Capabilities: Trans-Bridge Switch
Interface: FastEthernet0/0, Port ID (outgoing port): FastEthernet0/1
Holdtime : 141 sec
And retrieve two submatches: IP address and Port ID (in this case, 1.4.2.3, and FE0/1). I can retrieve the IP address just fine, but I am not able to get the Port ID in the same expression. One of the expressions I am using is:
"IP address: (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})([.\n]*)Port ID \(outgoing port\): (.*)"
because I do not know how many lines are between IP address and Port ID. Any help is greatly appreciated...
Kevin
Device ID: ArouterName
Entry address(es):
IP address: 1.4.2.3
Platform: cisco WS-C2924-XL, Capabilities: Trans-Bridge Switch
Interface: FastEthernet0/0, Port ID (outgoing port): FastEthernet0/1
Holdtime : 141 sec
And retrieve two submatches: IP address and Port ID (in this case, 1.4.2.3, and FE0/1). I can retrieve the IP address just fine, but I am not able to get the Port ID in the same expression. One of the expressions I am using is:
"IP address: (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})([.\n]*)Port ID \(outgoing port\): (.*)"
because I do not know how many lines are between IP address and Port ID. Any help is greatly appreciated...
Kevin