Showing results for 
Search instead for 
Did you mean: 

how to access RegEx ouput of two IP addresses?

Use case:

1.      'sh ip cache flow | I K' command on a router returns output as shown in attachment named screen shot 1.

2.      I have a regular expression to match for IP addresses. The output of this regular expression match is shown in attachment named screen shot 2. The match correctly returns two IP addresses, one is the source address ( and the other is the destination address ( in the actual network.

3.      In attachment named screen shot 3, I am mapping the source address of (using ‘First Match’) to a variable called ‘Source IP Address’ of type string.

4.      As you can see in screen shot 3, there is no way for me to access the next matching address (which is as there is nothing like ‘Next Match’ [or] ‘Last Match’ available to set the destination address variable. ‘All Matches’ option also shows greyed out in screen shot 3.

Question: How to get to the second address of which is shown as regex match output in screen shot 2?



Shaun Roberts
Cisco Employee
Cisco Employee

All matches is an array. You would have to for-each through it.

--Shaun Roberts
Principal Engineer, CX
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: