Re: Get the numbering of named regex groups

2015-04-08 Thread MRAB
On 2015-04-08 15:28, Peter Otten wrote: Mattias Ugelvik wrote: Example: re.match('(?Pa?)(?Pb?)', '') How can I find out that the group 'first' correlates to the positional regex group 1? I need to know this to resolve crucial ambiguities in a string manipulation tool I'm making. Looking at spa

Re: Get the numbering of named regex groups

2015-04-08 Thread Mattias Ugelvik
Thank god it's that easy! Err, I mean, thank you! I should have read the docs more carefully :) On 08/04/2015, Peter Otten <__pete...@web.de> wrote: > Mattias Ugelvik wrote: > >> Example: re.match('(?Pa?)(?Pb?)', '') >> >> How can I find out that the group 'first' correlates to the positional >> r

Re: Get the numbering of named regex groups

2015-04-08 Thread Peter Otten
Mattias Ugelvik wrote: > Example: re.match('(?Pa?)(?Pb?)', '') > > How can I find out that the group 'first' correlates to the positional > regex group 1? I need to know this to resolve crucial ambiguities in a > string manipulation tool I'm making. Looking at spans, as the example > above illust

Get the numbering of named regex groups

2015-04-08 Thread Mattias Ugelvik
Example: re.match('(?Pa?)(?Pb?)', '') How can I find out that the group 'first' correlates to the positional regex group 1? I need to know this to resolve crucial ambiguities in a string manipulation tool I'm making. Looking at spans, as the example above illustrates, won't do the job. I can't se