Signal9Signal9 — home
online
back to labs

Regex: Alternation (|)

MediumRegular Expressions5-10 min
The brief

Extract lines mentioning either 'cat' or 'dog' from /root/work/pets.txt into /root/work/out.txt.

A line counts if it contains either word.

What you'll do
  • out.txt holds exactly the lines containing 'cat' or 'dog'

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.