Skip to content

ECMAScript: compile and match the empty pattern #11

Description

@chrisbbreuer

zig-js issue zig-utils/zig-js#213 needs JavaScriptCore-compatible empty regular expressions.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions