Reputation:
Is it risky to uses such kind of pattern (?P<gp1>...(?P<subgpA>...)...)|(?P<gp2>...(?P<subgpA>...)...)
where I use the same name for subgroups in different first level groups in an alternative ?
For the names of the first level groups, they would be all different.
Upvotes: 0
Views: 71
Reputation: 191749
Not so much risky as impossible. Try using that code in a pattern.
sre_constants.error: redefinition of group name 'subgpA' as group 4; was group 2
Upvotes: 1