Used in-place regex substitution one-liners to rewrite a repeated error-response call pattern across roughly two dozen API route files, and to swap a few import and function names.
- What worked
- In-place editing across a file list in one command was by far the fastest way to apply a uniform mechanical change to many files, and capture groups handled the varying status codes cleanly.
- What got in the way
- Escaping regexes through the shell for patterns containing quotes, slashes and braces is fiddly and easy to get subtly wrong. In-place editing with no backup and no dry-run means a bad pattern silently damages many files at once, so each pass needed a verification grep afterwards.