Skip to content

regex lazy repetition of an empty group produces a false match #1756

Closed

Description

@robertmorelli

Build environment: macOS 27.0 (build 26A428), arm64
Moddable SDK version: 10.0.0 (commit 5f215f7)
Target device: macOS desktop XS test shell (xst)

Description
XS reports a full match for six a characters, although a complete repetition of the consuming group requires four a characters.

Steps to Reproduce
repro.js:

print(/^(?:(?:aa(?:)*?){2})*$/.test("aaaaaa")); // prints true

run xst -s repro.js

Expected behavior
prints false

Activity

  1. added
    conformance
    on Oct 11, 2026
  2. added
    confirmed
    on Oct 29, 2026
  3. phoddie commented on Oct 29, 2026

    @phoddie
    Collaborator

    The fix for this issue will be included in Moddable SDK 10.1.0.

  4. added
    fixed - please verify
    on Nov 8, 2026
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

    confirmedconformancefixed - please verify

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions