M
MRAB
I'm working on the sources for the regex module (_sre.c) but I've come
across some behaviour that I wasn't aware of before:
('b', 'a')
The regex module was modified to return this instead of the previous
('b', '') in issue #725106 because both Perl and sed returned this.
My version of the module returns ('b', None), which was what I thought/
expected was the correct answer. Could someone explain to me what the
rationale for returning ('b', 'a') is? Is it just because Perl and sed
do this? (And if so, why has it been decided that it shouldn't be
possible to split a string on a zero-width match even though Perl
does? :-()
across some behaviour that I wasn't aware of before:
('b', 'a')
The regex module was modified to return this instead of the previous
('b', '') in issue #725106 because both Perl and sed returned this.
My version of the module returns ('b', None), which was what I thought/
expected was the correct answer. Could someone explain to me what the
rationale for returning ('b', 'a') is? Is it just because Perl and sed
do this? (And if so, why has it been decided that it shouldn't be
possible to split a string on a zero-width match even though Perl
does? :-()