regex help: splitting string gets weird groups

gry georgeryoung at gmail.com
Thu Apr 8 16:36:28 EDT 2010


On Apr 8, 3:40 pm, MRAB <pyt... at mrabarnett.plus.com> wrote:

...
> Group 1 and group 4 match '='.
> Group 1 and group 3 match '1234'.
>
> If a group matches then any earlier match of that group is discarded,
Wow, that makes this much clearer!  I wonder if this behaviour
shouldn't be mentioned in some form in the python docs?
Thanks much!

> so:
>
> Group 1 finishes with '1234'.
> Group 2 finishes with 'in'.
> Group 3 finishes with '1234'.




More information about the Python-list mailing list