Day 26 10 min
Regex groups
1 / 13 · ≈ 9 min left
The problem
You are writing a small Node script that reads access.log from an API server and turns each line into an object. You need the date, the client IP, the method and the path out of every line. Parentheses in a JavaScript regex do that: each pair keeps the text it matched, and you read it back by number or by name.
The reps use three strings. A line of access.log: 2026-10-14 09:12:03 10.0.0.12 GET /api/users/42 200 18ms. A line of README.md with a typo: Run the the tests before you push. A line of app.conf: name="api" region="eu-west-1". Write each answer as a regex literal, /.../, with no flags unless the prompt asks for one.