I have a text file as shown below.    192.168.10.1   192.168.45.45    192.168.255.255    192.168.0.5    Random text comes here   8.8.8.8    224.23.25.12    225.1.2.3    226.0.0.0    227.1.2.6    227.25.25.26    228.145.123.45    229.255.255.255Random text come here 172.32.255.255231.25.12.12232.45.13.45238.0.0.0233.1.2.3234.255.255.255236.123.123.123237.153.125.155235.235.235.255239.239.239.10172.21.255.255172.31.10.10172.16.32.21Random text comes here 206.32.14.25I am using grep command to filter all the public IP addresses.And my output should be like this8.8.8.8172.32.255.255206.32.14.25My code works perfectly fine if I am not using -o flag. But if I add -o flag to get only the pattern I don't get any output.CODEegrep -vo  '172\.1[6-9]([\.][0-9]{1,3}){2}|172\.2[0-9]([\.][0-9]{1,3}){2}|172\.3[01]([\.][0-9]{1,3}){2}|10([\.][0-9]{1,3}){3}|192\.168([\.][0-9]{1,3}){2}|22[456789]([\.][0-9]{1,3}){3}|23[0-9]([\.][0-9]{1,3}){3}' private_ipAny help with this would be appreciated. Thank you
Problem with grep -o
shell script;text processing;grep