This is for an assignment so I have no choice but to use sed.
Given a file messages, how can I extract all the IP addresses and print them?
I first
Use sed -r (extended regex) or escape the capture groups with \
sed -r
\