I have this file containing following text.
200.200.200.253
80/tcp:filtered:http
443/tcp:filtered:https
200.200.200.254
80/tcp:filtered:http
443/tcp:filtered:https
web.example.com (200.200.200.250)
80/tcp:filtered:http
443/tcp:filtered:https
I want to use sed to add (:) in end of the IP addresses. so it will look like following.
200.200.200.253 :
80/tcp:filtered:http
443/tcp:filtered:https
200.200.200.254 :
80/tcp:filtered:http
443/tcp:filtered:https
web.example.com (200.200.200.250) :
80/tcp:filtered:http
443/tcp:filtered:https
I am having issue with web.example.com (200.200.200.250) regex match.
I want this line look like web.example.com (200.200.200.250) :
I got answer this is what i tried.
sed -e 's/[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}/&:/' file.txt
I suggest you to use