Skip to content

regex count+ not a subset of count matches #899

Open

Description

@robertmorelli

issue:

{2,0} should be a superset of {2}. Below is an example of where that is not currently true

repro:

import Foundation
let a = try! Regex(#"\A(?:^|a){2,}\z"#).matchingSemantics(.unicodeScalar)
let b = try! Regex(#"\A(?:^|a){2}\z"#).matchingSemantics(.unicodeScalar)
print((try! a.firstMatch(in: "a")) != nil)
print((try! b.firstMatch(in: "a")) != nil)

expected:

true, then true.

actual:

false, then true.

system:

Swift 6.4, macOS 27.0.

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