Message355989
It's been many years since I looked at the code, and there have been changes since then, so some of the details might not be correct.
As to have it should behave:
re.match('(?:()|(?(1)()|z)){1,2}(?(2)a|z)', 'a')
Iteration 1.
Match the repeated part. Group 1 matches.
Iteration 2.
Match the repeated part. Group 1 matches.
Has group 2 matched? No.
Try to match 'z'. Fail and backtrack.
Retry the repeated part.
Iteration 2.
Has group 1 matched? Yes.
Group 2 matches.
Has group 2 matched? Yes.
Try to match 'a'. Success. Group 1 matched and group 2 matched.
re.match('(?:()|(?(1)()|z)){1,2}(?(1)a|z)', 'a')
Iteration 1.
Match the repeated part. Group 1 matches.
Iteration 2.
Match the repeated part. Group 1 matches.
Has group 1 matched? Yes.
Try to match 'a'. Success. Group 1 matched and group 2 didn't match. |
|
Date |
User |
Action |
Args |
2019-11-05 00:48:04 | mrabarnett | set | recipients:
+ mrabarnett, ezio.melotti, abacabadabacaba, serhiy.storchaka, malin, LewisGaul, jacksonriley |
2019-11-05 00:48:04 | mrabarnett | set | messageid: <1572914884.25.0.398287333528.issue23692@roundup.psfhosted.org> |
2019-11-05 00:48:04 | mrabarnett | link | issue23692 messages |
2019-11-05 00:48:04 | mrabarnett | create | |
|