Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Knowing if a group in the pattern is matched and group name #100

@lieene

Description

@lieene

Summary

CaptureIndex should contain info to tell if a subgroup is matched and group name on a named group.

Motivation

group name and subgroup match state are needed in some cases.

Describe alternatives you've considered

As unmatched group always has a 0 start position and 0 lengths. So when full-match is not started at 0, comparing subgroup start with full-match start can tell if there is a match. but that does not solve the case when full-match starts at 0. And 0 length(anchor alike) subgroup will have 0 lengths, so testing length against 0 can only solve none-0-length groups.

the group name can be collected by parsing pattern sources.
it would be very helpful if group name and subgroup match state can be provided by CaptureIndex.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions