This is the data I am trying to parse:
10.186.128.0/20 172.17.128.161 0 65000 8788
10.186.128.0/20 172.17.128.161 0 65000 878
10.186.128.0/20 172.17.128.161 0 65000 87
Ideally the output should match the IP address from the beginning of the line and also last 2 or 3 or 4 digits. Example desired output:
10.186.128.0/20 8788
10.186.128.0/20 878
10.186.128.0/20 87
I have regex that will match the IP address "10\.\d*\.\d*\.\d*\/\d\d"
And then I have second regex that will match the last 2 or 3 or 4 digits " \d{4}$| \d{3}$| \d{2}$"
Question is how to combine those two regex expressions in PowerShell to achieve desired result?
Thanks