I am looking for a way to find and replace around a pattern. Say I have a list like the following:
word 192.168.9.10 anotherword
word 192.168.8.20 anotherword
word 192.168.7.30 anotherword
word 192.168.6.40 anotherword
word 192.168.5.50 anotherword
word 192.168.4.60 anotherword
word 192.168.3.70 anotherword
word 192.168.2.80 anotherword
word 192.168.1.90 anotherword
and I want to find/replace "word" and "anotherword" with "newword" and "newanotherword" like so:
newword 192.168.9.10 newanotherword
newword 192.168.8.20 newanotherword
newword 192.168.7.30 newanotherword
newword 192.168.6.40 newanotherword
newword 192.168.5.50 newanotherword
newword 192.168.4.60 newanotherword
newword 192.168.3.70 newanotherword
newword 192.168.2.80 newanotherword
newword 192.168.1.90 newanotherword
I want to find and replace around a variable string with a definite pattern (like an IP address) without changing said pattern. Is there any way to do this?
Thank you for reading and have a great day.
