#!/bin/bashs="111ipv4 12.34.33.4wwwipv4 12.34.33.2ipv4 12.34.33.5"sed -E '/ipv4/{s/[0-9]{1,3}(\.[0-9]{1,3}){3}/x.x.x.x/g;T;:a;n;ba}' <<< "$s"
Standard input is empty
111 ipv4 x.x.x.x www ipv4 12.34.33.2 ipv4 12.34.33.5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!