Verified Fixture FX-G04
What it does
A zero-length match is a real match of empty text, such as a* where no a follows. Engines list them differently.
How to use it
- Load the example: a* on "ba".
- Compare the empty matches in each engine.
- Use + instead of * if you do not want empty matches.
Verified example
As written
Text "ba"
a* Result: "", "a", ""
a* Result: "", "a", ""
a* Result: "", "a", ""
a* Result: "", "a"
Recorded by running fixture FX-G04 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
- Go does not report an empty match directly after a previous match; the others do.
Limits
- An empty match is neither missing input nor an error.