Skip to content

Clarify construction for repeatedly-entered backreferences #2

@geofflangdale

Description

@geofflangdale

For a pattern like /foo(.{1,5}(\w).{1,5}\2)+bar/ the capturing subexpression (\w) is entered and resolved many times, not just once.

This is a simple example, but it is my belief that a capturing subexpression can take on many values (and potentially go down many paths - this loop example is a comparatively simple case - we could have paths where the (\w) is optional in a loop and some other, non-capturing component is encountered instead, meaning that the (\w) used will be from the previous iteration.

Am I confused?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions