I'm trying to search and replace a string in a file on the Mac Terminal using sed. I'm able to search and replace a simple string:
sed -i.bak 's/HOSTS/BOASTS/g' file.txt
But I'm trying it on something a little more complicated, basically the string I want to replace looks something like 'HOSTS:"123.123.123.123, 12345"' - with the 123.123.123.123 being a variable IP so I can't exactly search for that, so I'm trying to use regular expressions, mainly the "." to indicate that I don't know what the IP address will be.
I've tried the following with no luck:
sed -i.bak 's/HOSTS:"., 00000"/HOSTS:"999.999.999.999, 00000"/g' file.txt