JavaScript regex in practice: greedy vs lazy, lookarounds, and the 300 ms pattern
Five regex behaviours that cause most of the "it matched too much / too little / hung the page" bugs I see, each with a runnable Node example (tested on Node 24). 1. Greedy . eats across boundaries const s = ' first and second ' ; s .