Retrieve multiple captures for unique group names

Create issue
Issue #375 new
Former user created an issue


I'm looking for a solution to a following problem: in my regex pattern there are unique group names in branches, which contain non-unique patterns:"(?|(?P<bla_1>aaa)|(?P<bla_2>aaa))", "maaa")

I would like to capture all group names which match the pattern, but so far .finditer / .findall / .search gives me only the first one.

Comments (2)

  1. Matthew Barnett repo owner

    I don’t have a solution. The purpose of regex is to find matches, not to find all of the ways it can/could match.

  2. Log in to comment