Skip to content

RegEx unable to parse "(\d)(?(1)yes|no)(\d)(\2)" #1595

@pgovind

Description

@pgovind

Pattern: @"(\d)(?(1)yes|no)(\d)(\2)"
Input: "0yes11"
Current Match: "0yes"
Correct Match: "0yes11"

I found this while reading through our CountCaptures() routine. The bug is that we set _ignoreNextParens to true when we parse an alternation construct and never set it back to false. As a result, we don't detect any subsequent captures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions