Hands-on task
This task is step 20 of the course “Regular expressions”
Extract IPv4 strictly
From /root/access.txt extract IPv4 addresses, but only valid ones — each octet from 0 to 255 (the log also contains junk "addresses" like 999.999.999.999). Write the result to /root/valid_ips.txt, one address per line, without duplicates.
What you'll practise:
- grep
- regex
- alternation
- ipv4