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

multiple named capturing groups #44

Open
@Konrud

Description

@Konrud

Perl, Ruby and .NET all allow multiple named capturing groups to share the same name in the regular expression. As of 07.2018, current implementations of named capturing groups in browsers (I've checked it in Chrome 67 and FF 61) don't allow this. So this regular expression for strict date analyze is invalid:

var dateRegExp = /^(?:(?<month>0?2)\/(?<day>[12][0-9]|0?[1-9])|(?<month>0?[469]|11)\/(?<day>30|[12][0-9]|0?[1-9])|(?<month>0?[13578]|1[02])\/(?<day>3[01]|[12][0-9]|0?[1-9]))\/(?<year>(?:[0-9]{2})?[0-9]{2})$/

Do you consider to add support for multiple named capturing groups?
I think it may help a lot. If we started to implement it as it in the other languages why don't implement it
thoroughly with all the features available?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions