Skip to content

nested capture groups #204

Closed
Closed
@charlierudolph

Description

@charlierudolph

Currently having a nested capture group regexp throws an error in the javascript version (see cucumber/cucumber-js#825)

// Two capture groups. The outer one should typically be non-capturing but doesn't need to be
/^a user( named "([^"]*)")?$/

// Workaround is to make the outer on non-capturing
/^a user(?: named "([^"]*)")?$/

I would suggest just throwing an error if there is a nested capture group and suggesting making the outer one non-capturing. Thoughts?

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