How to use Sed to replace all characters in between colons
How to replace all characters between colons using `sed`?
# replace easy with 123
sed:easy:abc -> sed:123:abc
# replace hardest with 123
sed:hardest:efg -> sed:123:efg
# replace magnificent with zyx
sed:magnificent:zyx -> sed:123:zyx
Try:
$ sed -e 's/:[^:]*:/:123:/' file sed:123:abc sed:123:efg sed:123:zyx