What it does
A regex that matches too much usually has a greedy .* that runs past the end you intended.
How to use it
- Load the failing case and see the single long match.
- Replace .* with a class that cannot cross the delimiter.
- Compare the corrected matches.
Verified example
As written
Text "<b>one</b> <i>two</i>"
<.*> Result: "<b>one</b> <i>two</i>"
Corrected
Text "<b>one</b> <i>two</i>"
<[^>]*> Result: "<b>", "</b>", "<i>", "</i>"
Recorded by running fixture FX-G02 on : rp.js@1 on Node v24.21.0 (V8), v24.21.0, CPython 3.14.2 (Pyodide 314.0.7), PCRE2 10.48, go1.27.1. JavaScript results come from the rp.js@1 core on Node’s V8; your browser runs the same core.
Engines
- Greedy repetition behaves the same in all four engines.
Limits
- This is not an HTML parser: quotes, nesting and comments are not handled.