Skip to content

| (or) in combination with capturing parentheses doesn't work #12

@jens-duttke

Description

@jens-duttke

I have a problem with the | operator and capturing groups in my regexp:

const MultiRegExp2 = require('multi-regexp2').default;

const matches = new MultiRegExp2(new RegExp('(a)|(b)')).execForAllGroups('b', true);

console.log(matches);
// -> null

Normally the matches should looks like this:
https://regex101.com/r/jn9DU9/1

Full match 0-1 b
Group 2. 0-1 b

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