Cut the fifth field (separated by a colon) from the /etc/groups file, sort the results and replace any IP addresses (in the form of x.x.x.x) with 1.1.1.1 using sed.
cut -f 5 -d':' /etc/groups | sort -u | xargs sed -i 's/([0-9]\{1,3\})\.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}/1.1.1.1/g'