Skip to content

Regex non-deterministicly fails #639

Open
@jasonbobier

Description

@jasonbobier

Description
Please see the attached playground. The regex in it will work sometimes and fail other times over the same data set. It fails because it isn't greedily consuming a ZeroOrMore.

Steps to reproduce
Open the enclosed playground. Keep changing portions (to cause a recompile) until it fails.

Expected behavior
The ZeroOrMores should consume the entire matching string in the whole match. Also, the same string processed by the same regex should always either fail or not fail.

Environment

  • Swift compiler version info: swift-driver version
    1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
    Target: arm64-apple-macosx13.0

  • Xcode version info:
    Xcode 14.2
    Build version 14C18

Mac.playground.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions