in reply to Re^8: Understanding a portion of perlretut
in thread Understanding a portion on the Perlretut

Interesting. I just noticed (|f+) behaves the same.

Running a simplified code with use re 'debug' gives the answer:

use re 'debug'; $s = 'xfx'; while ($s =~ / (f*?) /gx) {

Compiling REx " (f*?) " Final program: 1: OPEN1 (3) 3: MINMOD (4) 4: STAR (7) 5: EXACT <f> (0) 7: CLOSE1 (9) 9: END (0) minlen 0 xfx ------------ Matching REx " (f*?) " against "xfx" 0 <> <xfx> | 1:OPEN1(3) 0 <> <xfx> | 3:MINMOD(4) 0 <> <xfx> | 4:STAR(7) 0 <> <xfx> | 7: CLOSE1(9) 0 <> <xfx> | 9: END(0) Match successful! matched (f*?) of "", starting at offset of 0, ending at pos of 0 Matching REx " (f*?) " against "xfx" 0 <> <xfx> | 1:OPEN1(3) 0 <> <xfx> | 3:MINMOD(4) 0 <> <xfx> | 4:STAR(7) 0 <> <xfx> | 7: CLOSE1(9) 0 <> <xfx> | 9: END(0) Match possible, but length=0 is smaller than requested=1, failing! EXACT <f> can match 0 times out of 1 +... failed... 1 <x> <fx> | 1:OPEN1(3) 1 <x> <fx> | 3:MINMOD(4) 1 <x> <fx> | 4:STAR(7) 1 <x> <fx> | 7: CLOSE1(9) 1 <x> <fx> | 9: END(0) Match successful! matched (f*?) of "", starting at offset of 1, ending at pos of 1 Matching REx " (f*?) " against "fx" 1 <x> <fx> | 1:OPEN1(3) 1 <x> <fx> | 3:MINMOD(4) 1 <x> <fx> | 4:STAR(7) 1 <x> <fx> | 7: CLOSE1(9) 1 <x> <fx> | 9: END(0) Match possible, but length=0 is smaller than requested=1, failing! EXACT <f> can match 1 times out of 1 +... 2 <xf> <x> | 7: CLOSE1(9) 2 <xf> <x> | 9: END(0) Match successful! matched (f*?) of "f", starting at offset of 1, ending at pos of 2 Matching REx " (f*?) " against "x" 2 <xf> <x> | 1:OPEN1(3) 2 <xf> <x> | 3:MINMOD(4) 2 <xf> <x> | 4:STAR(7) 2 <xf> <x> | 7: CLOSE1(9) 2 <xf> <x> | 9: END(0) Match successful! matched (f*?) of "", starting at offset of 2, ending at pos of 2 Matching REx " (f*?) " against "x" 2 <xf> <x> | 1:OPEN1(3) 2 <xf> <x> | 3:MINMOD(4) 2 <xf> <x> | 4:STAR(7) 2 <xf> <x> | 7: CLOSE1(9) 2 <xf> <x> | 9: END(0) Match possible, but length=0 is smaller than requested=1, failing! EXACT <f> can match 0 times out of 1 +... failed... 3 <xfx> <> | 1:OPEN1(3) 3 <xfx> <> | 3:MINMOD(4) 3 <xfx> <> | 4:STAR(7) 3 <xfx> <> | 7: CLOSE1(9) 3 <xfx> <> | 9: END(0) Match successful! matched (f*?) of "", starting at offset of 3, ending at pos of 3 Matching REx " (f*?) " against "" 3 <xfx> <> | 1:OPEN1(3) 3 <xfx> <> | 3:MINMOD(4) 3 <xfx> <> | 4:STAR(7) 3 <xfx> <> | 7: CLOSE1(9) 3 <xfx> <> | 9: END(0) Match possible, but length=0 is smaller than requested=1, failing! EXACT <f> can match 0 times out of 1 +... failed... Match failed Freeing REx: " (f*?) "

Do you see?

Match possible, but length=0 is smaller than requested=1, failing!
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,