21 Dec
2020
21 Dec
'20
12:50 p.m.
On 21 Dec 2020, at 13:46, Taco Hoekwater
wrote: On 21 Dec 2020, at 13:16, Mojca Miklavec
wrote: My only explanation would be that perhaps "^1" is so greedy that the rest of the pattern doesn't get found. But I don't want to believe that explanation.
Which (of course) means that that is exactly what happens ;)
The ones that match are
ababbb (a (ba+bb) b) => r4 r1(r3(r5 r4) r2(r5 r5)) r5 abbbab (a (bb+ba) b) => r4 r1(r2(r5 r5) r3(r5 r4)) r5
With the ^1, in the “bb” cases the first “b” eats all three “b”s:
ababbb fails the r5 at the end
Sorry, that was wrong, it fails at the second r5 in the r2 as well, for the same reason as below.
abbbab fails the first r2 already (since the second r5 therein never happens)
Best wishes, Taco