Skip to content

Support for conditional capture groups #23

@tom-lord

Description

@tom-lord

Conditional capture groups, e.g. /(group1)? (?(1)yes|no)/.examples are not yet supported.

This example should return: ["group1 yes", " no"].

This has been a feature of the ruby language since v2.0.0, although it is a little-known/rarely used language feature.

Note that unfortunately, a common use case is to use conditional capture groups in conjunction with look-arounds - which this library cannot support.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions