You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ECMAScript: compile and match the empty pattern #11
ECMAScript treats an empty pattern as a valid zero-width regex, but Regex.compileWithFlags currently returns RegexError.EmptyPattern before the parser can build its existing empty AST node.
Acceptance criteria:
Empty patterns compile successfully.
find and findFrom return a zero-width match at the requested valid position.
Iteration/search callers can advance after zero-width matches without an engine loop.
Existing non-empty behavior remains covered.
README/API documentation no longer claims empty patterns are rejected.
Implemented and pushed to main in fd4927c. Empty ECMAScript patterns now compile and produce zero-width matches at the start, requested findFrom position, and end of input. Focused regression: zig test src/regex.zig --test-filter "compile empty pattern" (1/1 passed). zig-utils/zig-js#213 will consume this directly.
Activity
fix(regex): support empty ECMAScript patterns (#11)
chrisbbreuer commentedon Jul 17, 2026
Implemented and pushed to
mainin fd4927c. Empty ECMAScript patterns now compile and produce zero-width matches at the start, requestedfindFromposition, and end of input. Focused regression:zig test src/regex.zig --test-filter "compile empty pattern"(1/1 passed). zig-utils/zig-js#213 will consume this directly.