in reply to help with lazy matching

$ perl -e "use Path::Tiny; print path( q{ro/sham/bo} )->basename " $ perl -Mre=debug -e " $_ = q{ro/sham/bo} ; print m{/([^/]+?)$} " Compiling REx "/([^/]+?)$" Final program: 1: EXACT </> (3) 3: OPEN1 (5) 5: MINMOD (6) 6: PLUS (18) 7: ANYOF[\x00-.0-\xff][{unicode_all}] (0) 18: CLOSE1 (20) 20: EOL (21) 21: END (0) anchored "/" at 0 floating ""$ at 2..2147483647 (checking anchored) mi +nlen 2 Guessing start of match in sv for REx "/([^/]+?)$" against "ro/sham/bo +" Found anchored substr "/" at offset 2... Found floating substr ""$ at offset 10... Starting position does not contradict /^/m... Guessed: match at offset 2 Matching REx "/([^/]+?)$" against "/sham/bo" 2 <ro> </sham/bo> | 1:EXACT </>(3) 3 <ro/> <sham/bo> | 3:OPEN1(5) 3 <ro/> <sham/bo> | 5:MINMOD(6) 3 <ro/> <sham/bo> | 6:PLUS(18) ANYOF[\x00-.0-\xff][{unicode_all}] c +an match 1 times out of 1... 4 <ro/s> <ham/bo> | 18: CLOSE1(20) 4 <ro/s> <ham/bo> | 20: EOL(21) failed... ANYOF[\x00-.0-\xff][{unicode_all}] c +an match 1 times out of 1... 5 <ro/sh> <am/bo> | 18: CLOSE1(20) 5 <ro/sh> <am/bo> | 20: EOL(21) failed... ANYOF[\x00-.0-\xff][{unicode_all}] c +an match 1 times out of 1... 6 <ro/sha> <m/bo> | 18: CLOSE1(20) 6 <ro/sha> <m/bo> | 20: EOL(21) failed... ANYOF[\x00-.0-\xff][{unicode_all}] c +an match 1 times out of 1... 7 <ro/sham> </bo> | 18: CLOSE1(20) 7 <ro/sham> </bo> | 20: EOL(21) failed... ANYOF[\x00-.0-\xff][{unicode_all}] c +an match 0 times out of 1... failed... 7 <ro/sham> </bo> | 1:EXACT </>(3) 8 <ro/sham/> <bo> | 3:OPEN1(5) 8 <ro/sham/> <bo> | 5:MINMOD(6) 8 <ro/sham/> <bo> | 6:PLUS(18) ANYOF[\x00-.0-\xff][{unicode_all}] c +an match 1 times out of 1... 9 <ro/sham/b> <o> | 18: CLOSE1(20) 9 <ro/sham/b> <o> | 20: EOL(21) failed... ANYOF[\x00-.0-\xff][{unicode_all}] c +an match 1 times out of 1... 10 <ro/sham/bo> <> | 18: CLOSE1(20) 10 <ro/sham/bo> <> | 20: EOL(21) 10 <ro/sham/bo> <> | 21: END(0) Match successful! boFreeing REx: "/([^/]+?)$" $