I have the following input:
192.168.1.5:5555 device
192.168.1.9:5555 offline
192.168.1.12:5555 device
192.168.1.13:5555 offline
This is the regex I'm using to match IP address and port number:
([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\:\d{0,5}
The correct match would be only when there is not tabulation and then the word "offline". So I wrote the following regex and added that to the end of the previous regex:
(?!\t*offline)
but sadly I don't get the desired output, which should be:
192.168.1.5:5555 device
192.168.1.12:5555 device