-4

I am using python 3 and I am trying to get the ip address of the process, using netstat -nb. I managed to get using subprocess module the following string:

TCP 192.168.1.22:65477 212.55.188.116:443 ESTABLISHED\n [WinStore.App.exe]

My question is, how can i get using regex the ip address - "212.55.188.116".

Anna
  • 1
  • 4

1 Answers1

0

If the lengths are consistent with the IP Your trying to search you could use something along the lines of:

((\d{3}.)\d{2}.(\d{3}.){2}\d{3})
Tom
  • 685
  • 8
  • 17