Day 25 10 min
Regex basics
1 / 13 · ≈ 9 min left
The problem
The log viewer of your team has a filter box that takes a JavaScript regular expression, typed as /pattern/flags. A "keep" prompt asks for a regex that matches exactly the lines named. A "match" prompt asks for a regex whose first match in each line is exactly the text named.
The payment service wrote 7 lines in the last minute: ERROR order 4821 failed: timeout, INFO order 4822 paid, WARN disk 91% full, error order 77 failed: card declined, INFO user ana@example.com logged in, INFO order 4823 paid in 2 tries and DEBUG cache hit.